BooleanFieldFactory extends AbstractFieldFactory<Boolean> { @Override public Boolean newInstance(int uniqueId) { return isEven(uniqueId); }  @Override Boolean newInstance(int uniqueId); static FieldFactory<Boolean> valueOf(String name); static final BooleanFieldFactory TICK_TOCK; static final AbstractFieldFactory<Boolean> ALWAYS_TRUE; static final AbstractFieldFactory<Boolean> ALWAYS_FALSE; }
@Test(dataProvider = "newInstanceDataProvider") public void newInstance(int uniqueId, Boolean expectedValue) { assertEquals(BooleanFieldFactory.TICK_TOCK.newInstance(uniqueId), expectedValue); }
@Test(invocationCount = 10) public void alwaysTrue() { int uniqueId = RandomUtils.nextInt(0, Integer.MAX_VALUE); assertTrue(BooleanFieldFactory.ALWAYS_TRUE.newInstance(uniqueId)); }
@Test(invocationCount = 10) public void alwaysFalse() { int uniqueId = RandomUtils.nextInt(0, Integer.MAX_VALUE); assertFalse(BooleanFieldFactory.ALWAYS_FALSE.newInstance(uniqueId)); }