InconsistencyParameter implements NetworkParameter, Comparable<InconsistencyParameter> { @Override public boolean equals(Object obj) { if (obj instanceof InconsistencyParameter) { InconsistencyParameter other = (InconsistencyParameter) obj; return d_cycle.equals(other.d_cycle); } return false; } InconsistencyParameter(List<Treatment> cycle); String getName(); List<Treatment> getCycle(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); int compareTo(InconsistencyParameter other);  }
@Test public void testEquals() { List<Treatment> cycle1 = Arrays.asList(new Treatment("A"), new Treatment("B"), new Treatment("C"), new Treatment("A")); List<Treatment> cycle2 = Arrays.asList(new Treatment("A"), new Treatment("C"), new Treatment("B"), new Treatment("A")); InconsistencyParameter parameter = new InconsistencyParameter(cycle1); assertEquals(parameter, new InconsistencyParameter(cycle1)); assertEquals(parameter.hashCode(), new InconsistencyParameter(cycle1).hashCode()); assertFalse(parameter.equals(new InconsistencyParameter(cycle2))); }