Result { public Result combine(Result other) { return new Result(this.isPass() && other.isPass(), this.isDescend() && other.isDescend()); } private  Result(boolean success, boolean recurse); boolean isDescend(); boolean isPass(); Result combine(Result other); Result negate(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static final Result PASS; static final Result FAIL; static final Result STOP; }
@Test public void equalsPass() { Result one = Result.PASS; Result two = Result.PASS.combine(Result.PASS); assertEquals(one, two); }
@Test public void equalsFail() { Result one = Result.FAIL; Result two = Result.FAIL.combine(Result.FAIL); assertEquals(one, two); }
@Test public void equalsStop() { Result one = Result.STOP; Result two = Result.STOP.combine(Result.STOP); assertEquals(one, two); }