ShouldForkResult { public ShouldForkResult and(ShouldForkResult otherShouldForkResult) { if (isForkable()) { return otherShouldForkResult; } return this; } private  ShouldForkResult(boolean shouldFork, String reason); static ShouldForkResult shouldForkResult(); static ShouldForkResult shouldNotForkResult(String reason); ShouldForkResult and(ShouldForkResult otherShouldForkResult); boolean isForkable(); String getReason(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final String NO_REASON; }
@Test(dataProvider = "test2Ands") public void testAnd(ShouldForkResult shouldForkResult, ShouldForkResult shouldForkResult2, boolean result, String reason) { assertEquals(shouldForkResult.and(shouldForkResult2).isForkable(), result); assertEquals(shouldForkResult.and(shouldForkResult2).getReason(), reason); }