Template { @Override public int hashCode() { return Objects.hashCode(primaryType, mixinTypes, Arrays.asList(properties), getTemplateType(), childName); } 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 testHashCode() throws IOException { PropertyState primary = createProperty("primary", "primary"); PropertyState mixin = createProperty("mixin", "mixin"); PropertyTemplate[] properties = new PropertyTemplate[0]; Template t0 = new Template(store.getReader(), primary, mixin, properties, ""); Template t1 = new Template(store.getReader(), primary, mixin, properties, null); assertNotEquals(t0.hashCode(), t1.hashCode()); }
@Test public void testHashCode2() throws IOException { PropertyState primary = createProperty("primary", "primary"); PropertyState mixin = createProperty("mixin", new ArrayList<String>(), Type.STRINGS); PropertyTemplate[] properties = new PropertyTemplate[0]; String childNode = "c"; Template t0 = new Template(store.getReader(), primary, null, properties, childNode); Template t1 = new Template(store.getReader(), primary, mixin, properties, childNode); assertNotEquals(t0.hashCode(), t1.hashCode()); }