SplitParameter implements NetworkParameter, Comparable<SplitParameter> { @Override public boolean equals(Object obj) { if (obj instanceof SplitParameter) { SplitParameter other = (SplitParameter) obj; return d_base.equals(other.d_base) && d_subj.equals(other.d_subj) && d_direct == other.d_direct; } return false; } SplitParameter(Treatment base, Treatment subj, boolean direct); String getName(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); int compareTo(SplitParameter other); Treatment getBaseline(); Treatment getSubject(); boolean isDirect();  }
@Test public void testEquals() { Treatment t1 = new Treatment("A_1"); Treatment t2 = new Treatment("B52"); Treatment t3 = new Treatment("C"); assertEquals(new SplitParameter(t1, t2, true), new SplitParameter(t1, t2, true)); assertEquals(new SplitParameter(t1, t2, true).hashCode(), new SplitParameter(t1, t2, true).hashCode()); assertFalse(new SplitParameter(t1, t2, true).equals(new SplitParameter(t3, t2, true))); assertFalse(new SplitParameter(t1, t2, true).equals(new SplitParameter(t1, t3, true))); assertFalse(new SplitParameter(t1, t2, true).equals(new SplitParameter(t1, t2, false))); }