### Question:
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);  }### Answer:
@Test public void non_specimen_type_request_returns_no_specimen() { Object result = this.setBuilder.create("string", null); assertEquals(new NoSpecimen(), result); }
@Test public void non_set_specimen_type_return_no_specimen() { Object result = this.setBuilder.create(SpecimenType.of(List.class), null); assertEquals(new NoSpecimen(), result); }
@Test public void non_interface_set_specimen_type_returns_no_specimen() { Object result = this.setBuilder.create(SpecimenType.of(LinkedHashSet.class), null); assertEquals(new NoSpecimen(), result); }
@Test public void class_type_assignable_to_set_returns_instance_of_hash_set() { Object result = this.setBuilder.create(SpecimenType.of(Set.class), null); assertTrue(result instanceof HashSet); }