List<EqClass> (EqClass eqClass, DfaMemoryStateImpl other) { Int2ObjectMap<EqClass> groupsInClasses = new Int2ObjectOpenHashMap<>(); List<EqClass> groups = new ArrayList<>(); for (DfaVariableValue value : eqClass.asList()) { int otherClass = other.getEqClassIndex(value); EqClass list; if (otherClass == -1) { list = new EqClass(myFactory); groups.add(list); } else { list = groupsInClasses.get(otherClass); if (list == null) { list = new EqClass(myFactory); groupsInClasses.put(otherClass, list); } } list.add(value.getID()); } groups.addAll(groupsInClasses.values()); return groups; }