Design a leak-free class based using the given Strings class.