LinkedHashSet<EqClass> () { if (myCachedNonTrivialEqClasses != null) return myCachedNonTrivialEqClasses; LinkedHashSet<EqClass> result = new LinkedHashSet<>(); for (EqClass eqClass : myEqClasses) { if (eqClass != null && eqClass.size() > 1) { result.add(eqClass); } } return myCachedNonTrivialEqClasses = result; }