InvertedIndexValueIterator<Value> () { return new InvertedIndexValueIterator<Value>() { int myNextId = 1; ValueIterator<Value> myCurrent = myContainers.get(0).getValueIterator(); @Override public @NotNull IntIterator getInputIdsIterator() { return myCurrent.getInputIdsIterator(); } @Override public @Nullable IntPredicate getValueAssociationPredicate() { return myCurrent.getValueAssociationPredicate(); } @Override public Object getFileSetObject() { return null; } @Override public boolean hasNext() { while (true) { if (myCurrent.hasNext()) return true; if (myNextId < myContainers.size()) { myCurrent = myContainers.get(myNextId++).getValueIterator(); } else { return false; } } } @Override public Value next() { return myCurrent.next(); } }; }