Partition { @Override public boolean equals(Object obj) { if (obj instanceof Partition) { Partition other = (Partition) obj; return other.d_parts.equals(d_parts); } return false; } Partition(Collection<Part> parts); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); Set<Part> getParts(); Partition reduce(); List<Treatment> asCycle();  }
@Test public void testEquals() { assertEquals(new Partition(Collections.singleton(d_p1)), new Partition(Collections.singleton(d_p1))); assertEquals(new Partition(Collections.singleton(d_p1)).hashCode(), new Partition(Collections.singleton(d_p1)).hashCode()); JUnitUtil.assertNotEquals(new Partition(Collections.singleton(d_p1)), new Partition(Arrays.asList(d_p2, d_p3))); JUnitUtil.assertNotEquals(new Partition(Collections.singleton(d_p1)), new Partition(Collections.singleton(d_p6))); }