How would I write a generic InternPool in Java? Does it need a Internable interface?
InternPool
Internable
String in Java has interning cap
String
For an example take a look at Interner from Guava. It does not require an Internable interface, it just relies on equals and hashCode.
Interner
equals
hashCode