Template { @Override public boolean equals(Object object) { if (this == object) { return true; } else if (object instanceof Template) { Template that = (Template) object; return Objects.equal(primaryType, that.primaryType) && Objects.equal(mixinTypes, that.mixinTypes) && Arrays.equals(properties, that.properties) && Objects.equal(childName, that.childName); } else { return false; } } Template(@NotNull SegmentReader reader,
             @Nullable PropertyState primaryType,
             @Nullable PropertyState mixinTypes,
             @Nullable  PropertyTemplate[] properties,
             @Nullable String childName);   Template(@NotNull SegmentReader reader, @NotNull NodeState state); NodeState getChildNode(String name, RecordId recordId); boolean compare(RecordId thisId, RecordId thatId); @Override boolean equals(Object object); @Override int hashCode(); @Override String toString(); int estimateMemoryUsage();  }
@Test public void testEquals() throws IOException { PropertyState primary = createProperty("primary", "primary"); PropertyState mixin = createProperty("mixin", "mixin"); PropertyTemplate p0 = new PropertyTemplate(createProperty("p0", "v0")); PropertyTemplate p1 = new PropertyTemplate(createProperty("p1", "v1")); PropertyTemplate[] pt0 = new PropertyTemplate[] { p0, p1 }; PropertyTemplate[] pt1 = new PropertyTemplate[] { p1, p0 }; String childNode = "c"; Template t0 = new Template(store.getReader(), primary, mixin, pt0, childNode); Template t1 = new Template(store.getReader(), primary, mixin, pt1, childNode); assertEquals(t0, t1); }