Iterator<DistinctPair> () { return new Iterator<>() { final LongIterator iterator = myData.iterator(); @Override public boolean hasNext() { return iterator.hasNext(); } @Override public DistinctPair next() { return decode(iterator.nextLong()); } @Override public void remove() { iterator.remove(); } }; }