### Question:
TreeType implements Comparable<TreeType> { @Override public int compareTo(TreeType o) { if (this.equals(o)) return 0; int typeResult = type.getName().compareTo(o.type.getName()); if (typeResult != 0) return typeResult; int sizeDiff = children.size() - o.children.size(); if (sizeDiff != 0) return sizeDiff > 0 ? 1 : -1; for (int i = 0, s = children.size(); i < s; i++) { int childCompare = children.get(i).compareTo(o.children.get(i)); if (childCompare != 0) return childCompare; } return 0; } TreeType(ISerializedObjectTree tree); @Override int compareTo(TreeType o); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void equal() throws IOException { ISerializedObjectTree source = Trees.fromResource(getClass(), "equal"); ISerializedObjectTree match= Trees.fromResource(getClass(), "equal-match"); TreeType sourceType=new TreeType(source); TreeType matchType=new TreeType(match); assertEquals(matchType,sourceType); assertTrue(matchType.compareTo(sourceType)==0); }