It looks like you're looking for HashSet<E> where E needs to override equals and hashCode. Your uniqueness guarantee depends on your hashCode and equals implementations.