long () { long count = 0L; Set<Integer> uniqueValues = new HashSet<>(); boolean first = true; for (Integer i : new Integer[]{1, 2, 3, 2, 3}) { if (first) { first = false; continue; } if (uniqueValues.add(i)) { count++; } } return count; }