Here you can find the source of uniques(final int[] ints)
public static int uniques(final int[] ints)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static int uniques(final int[] ints) { final Set<Integer> set = new HashSet<Integer>(); for (int i = 0; i < ints.length; i++) { set.add(ints[i]);/*from w ww. j av a 2 s. c o m*/ } return set.size(); } }