IntSet (final IntSet acc, final boolean isField, final boolean root, final Predicate<? super ProtoMember> isSame, final int reflcass) { if (acc.contains(reflcass)) { return acc; // SOE prevention } final Iterable<ClassRepr> reprs = reprsByName(reflcass, ClassRepr.class); if (!Iterators.isEmpty(reprs)) { if (!root) { Iterable<ClassRepr> reprsWithoutMatchingMember = Iterators.filter(reprs, repr -> { for (ProtoMember m : isField? repr.getFields() : repr.getMethods()) { if (isSame.test(m)) { return false; } } return true; }); if (Iterators.isEmpty(reprsWithoutMatchingMember)) { return acc; } // should continue, if at least one repr does not have matching member defined acc.add(reflcass); } final IntSet subclasses = myClassToSubclasses.get(reflcass); if (subclasses != null) { final IntIterator subclassIterator = subclasses.iterator(); while (subclassIterator.hasNext()) { propagateMemberAccessRec(acc, isField, false, isSame, subclassIterator.nextInt()); } } } return acc; }