@Test public void boolean_type_returns_alternating_value_initially_true() { Object a = booleanGenerator.create(Boolean.class, null); Object b = booleanGenerator.create(Boolean.class, null); Object c = booleanGenerator.create(Boolean.class, null); Object d = booleanGenerator.create(Boolean.class, null); assertEquals(true, a); assertEquals(false, b); assertEquals(true, c); assertEquals(false, d); }
@Override public Object create(Object request, SpecimenContext context) { if (!request.equals(Boolean.class)) { return new NoSpecimen(); } value = !value; return value; }
SwitchingBooleanGenerator implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!request.equals(Boolean.class)) { return new NoSpecimen(); } value = !value; return value; } }
SwitchingBooleanGenerator implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!request.equals(Boolean.class)) { return new NoSpecimen(); } value = !value; return value; }  }
SwitchingBooleanGenerator implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!request.equals(Boolean.class)) { return new NoSpecimen(); } value = !value; return value; }  @Override Object create(Object request, SpecimenContext context); }
SwitchingBooleanGenerator implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!request.equals(Boolean.class)) { return new NoSpecimen(); } value = !value; return value; }  @Override Object create(Object request, SpecimenContext context);  }