List<Object> (List<? extends Number> numbers) { List<Object> list = new ArrayList<>(); Set<Number> uniqueValues = new HashSet<>(); for (Number number : numbers) { if (uniqueValues.add(number)) { list.add(number); } } return list; }