// Path: src/main/java/org/edmcouncil/rdf_toolkit/model/SortedTurtleObjectList.java
// public class SortedTurtleObjectList extends TreeSet<Value> {
// 
//   public SortedTurtleObjectList(ComparisonContext comparisonContext) {
//     super(new ValueComparator(comparisonContext));
//   }
// 
//   public SortedTurtleObjectList(Class<Value> collectionClass,
//                                 ComparisonContext comparisonContext) {
//     super(new ValueComparator(collectionClass, comparisonContext));
//   }
// }
// 
// Path: src/main/java/org/edmcouncil/rdf_toolkit/model/SortedTurtlePredicateObjectMap.java
// public class SortedTurtlePredicateObjectMap extends SortedHashMap<IRI, SortedTurtleObjectList> {
// 
//   public SortedTurtlePredicateObjectMap() {
//     super(new IRIComparator());
//   }
// 
//   public int fullSize() {
//     int result = 0;
//     for (Resource pred : keySet()) {
//       result += get(pred).size();
//     }
//     return result;
//   }
// }


import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import org.eclipse.rdf4j.model.BNode;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Value;
import org.edmcouncil.rdf_toolkit.model.SortedTurtleObjectList;
import org.edmcouncil.rdf_toolkit.model.SortedTurtlePredicateObjectMap;
import java.util.ArrayList;
    if ((map1 == null) || excludedList.contains(map1)) {
      if ((map2 == null) || excludedList.contains(map2)) {
        return 0; // two null/excluded maps are equal
      } else {
        return -1; // null/excluded map comes before non-null/excluded map
      }
    } else {
      if ((map2 == null) || excludedList.contains(map2)) {
        return 1; // non-null/excluded map comes before null/excluded map
      } else {
        Iterator<IRI> iter1 = map1.sortedKeys().iterator();
        Iterator<IRI> iter2 = map2.sortedKeys().iterator();
        return compare(map1, iter1, map2, iter2, excludedList);
      }
    }
  }

  private int compare(SortedTurtlePredicateObjectMap map1, Iterator<IRI> iter1,
                      SortedTurtlePredicateObjectMap map2, Iterator<IRI> iter2,
                      List<Object> excludedList) {
    if (iter1.hasNext()) {
      if (iter2.hasNext()) {
        IRI key1 = iter1.next();
        IRI key2 = iter2.next();
        excludedList.add(map1);
        excludedList.add(map2);
        int cmp = iriComparator.compare(key1, key2, excludedList);
        if (cmp != 0) {
          return cmp;
        } else { // predicate keys are the same, so test object values
// Path: src/main/java/org/edmcouncil/rdf_toolkit/model/SortedTurtleObjectList.java
// public class SortedTurtleObjectList extends TreeSet<Value> {
// 
//   public SortedTurtleObjectList(ComparisonContext comparisonContext) {
//     super(new ValueComparator(comparisonContext));
//   }
// 
//   public SortedTurtleObjectList(Class<Value> collectionClass,
//                                 ComparisonContext comparisonContext) {
//     super(new ValueComparator(collectionClass, comparisonContext));
//   }
// }
// 
// Path: src/main/java/org/edmcouncil/rdf_toolkit/model/SortedTurtlePredicateObjectMap.java
// public class SortedTurtlePredicateObjectMap extends SortedHashMap<IRI, SortedTurtleObjectList> {
// 
//   public SortedTurtlePredicateObjectMap() {
//     super(new IRIComparator());
//   }
// 
//   public int fullSize() {
//     int result = 0;
//     for (Resource pred : keySet()) {
//       result += get(pred).size();
//     }
//     return result;
//   }
// }


// Path: src/main/java/org/edmcouncil/rdf_toolkit/comparator/TurtlePredicateObjectMapComparator.java
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import org.eclipse.rdf4j.model.BNode;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Value;
import org.edmcouncil.rdf_toolkit.model.SortedTurtleObjectList;
import org.edmcouncil.rdf_toolkit.model.SortedTurtlePredicateObjectMap;
import java.util.ArrayList;

    if ((map1 == null) || excludedList.contains(map1)) {
      if ((map2 == null) || excludedList.contains(map2)) {
        return 0; // two null/excluded maps are equal
      } else {
        return -1; // null/excluded map comes before non-null/excluded map
      }
    } else {
      if ((map2 == null) || excludedList.contains(map2)) {
        return 1; // non-null/excluded map comes before null/excluded map
      } else {
        Iterator<IRI> iter1 = map1.sortedKeys().iterator();
        Iterator<IRI> iter2 = map2.sortedKeys().iterator();
        return compare(map1, iter1, map2, iter2, excludedList);
      }
    }
  }

  private int compare(SortedTurtlePredicateObjectMap map1, Iterator<IRI> iter1,
                      SortedTurtlePredicateObjectMap map2, Iterator<IRI> iter2,
                      List<Object> excludedList) {
    if (iter1.hasNext()) {
      if (iter2.hasNext()) {
        IRI key1 = iter1.next();
        IRI key2 = iter2.next();
        excludedList.add(map1);
        excludedList.add(map2);
        int cmp = iriComparator.compare(key1, key2, excludedList);
        if (cmp != 0) {
          return cmp;
        } else { // predicate keys are the same, so test object values
          SortedTurtleObjectList values1 = map1.get(key1);