code: public int getUnique() {
          TIntHashSet inUse = new TIntHashSet();
          for (int i = 0; i < length; i++) {
              inUse.add(get(i));
          }
          return inUse.size();
      }
docs: Gets the number of unique entries in the array