Set set = new HashSet<>(); short one = 1; set.add(one); Number n = one; set.remove(n); // no warning