@Test public void non_enum_specimen_type_request_returns_no_specimen() { Object result = this.enumBuilder.create(SpecimenType.of(Integer.class), null); assertEquals(new NoSpecimen(), result); }
@Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType) request; Class requestClass = specimenType.getRawType(); if (!(requestClass.isEnum())) { return new NoSpecimen(); } ensureListMapContainsList(requestClass); return getNextEnumValue(requestClass); }
EnumBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType) request; Class requestClass = specimenType.getRawType(); if (!(requestClass.isEnum())) { return new NoSpecimen(); } ensureListMapContainsList(requestClass); return getNextEnumValue(requestClass); } }
EnumBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType) request; Class requestClass = specimenType.getRawType(); if (!(requestClass.isEnum())) { return new NoSpecimen(); } ensureListMapContainsList(requestClass); return getNextEnumValue(requestClass); }  }
EnumBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType) request; Class requestClass = specimenType.getRawType(); if (!(requestClass.isEnum())) { return new NoSpecimen(); } ensureListMapContainsList(requestClass); return getNextEnumValue(requestClass); }  @Override Object create(Object request, SpecimenContext context); }
EnumBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType) request; Class requestClass = specimenType.getRawType(); if (!(requestClass.isEnum())) { return new NoSpecimen(); } ensureListMapContainsList(requestClass); return getNextEnumValue(requestClass); }  @Override Object create(Object request, SpecimenContext context);  }