@Test public void non_set_specimen_type_return_no_specimen() { Object result = this.setBuilder.create(SpecimenType.of(List.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 (!Set.class.isAssignableFrom(requestClass)) { return new NoSpecimen(); } if (!requestClass.isInterface()) { return new NoSpecimen(); } return new HashSet(); }
SetBuilder 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 (!Set.class.isAssignableFrom(requestClass)) { return new NoSpecimen(); } if (!requestClass.isInterface()) { return new NoSpecimen(); } return new HashSet(); } }
SetBuilder 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 (!Set.class.isAssignableFrom(requestClass)) { return new NoSpecimen(); } if (!requestClass.isInterface()) { return new NoSpecimen(); } return new HashSet(); }  }
SetBuilder 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 (!Set.class.isAssignableFrom(requestClass)) { return new NoSpecimen(); } if (!requestClass.isInterface()) { return new NoSpecimen(); } return new HashSet(); }  @Override Object create(Object request, SpecimenContext context); }
SetBuilder 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 (!Set.class.isAssignableFrom(requestClass)) { return new NoSpecimen(); } if (!requestClass.isInterface()) { return new NoSpecimen(); } return new HashSet(); }  @Override Object create(Object request, SpecimenContext context);  }