import java.util.*; class Test { void use() { Set set = new HashSet<>(); set.add("foo"); set.add("foo"); } }