@Test public void non_iterable_specimen_type_return_no_specimen() { Object result = this.iterableBuilder.create(SpecimenType.of(Map.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; if (!Iterable.class.isAssignableFrom(specimenType.getRawType())) { return new NoSpecimen(); } if (!specimenType.getRawType().isInterface()) { return new NoSpecimen(); } return new ArrayList(); }
IterableBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType) request; if (!Iterable.class.isAssignableFrom(specimenType.getRawType())) { return new NoSpecimen(); } if (!specimenType.getRawType().isInterface()) { return new NoSpecimen(); } return new ArrayList(); } }
IterableBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType) request; if (!Iterable.class.isAssignableFrom(specimenType.getRawType())) { return new NoSpecimen(); } if (!specimenType.getRawType().isInterface()) { return new NoSpecimen(); } return new ArrayList(); }  }
IterableBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType) request; if (!Iterable.class.isAssignableFrom(specimenType.getRawType())) { return new NoSpecimen(); } if (!specimenType.getRawType().isInterface()) { return new NoSpecimen(); } return new ArrayList(); }  @Override Object create(Object request, SpecimenContext context); }
IterableBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof SpecimenType)) { return new NoSpecimen(); } SpecimenType specimenType = (SpecimenType) request; if (!Iterable.class.isAssignableFrom(specimenType.getRawType())) { return new NoSpecimen(); } if (!specimenType.getRawType().isInterface()) { return new NoSpecimen(); } return new ArrayList(); }  @Override Object create(Object request, SpecimenContext context);  }