@Test public void different_class_type_does_not_invoke_builder() { this.builder.create(String.class, null); verify(this.mockSpecimenBuilder, never()).create(); }
@Override public Object create(Object request, SpecimenContext context) { if(request instanceof SeededRequest) { SeededRequest sr = (SeededRequest)request; request = sr.getRequest(); } if (!(request instanceof Type)) { return new NoSpecimen(); } Type type = (Type)request; if (!this.specimenType.equals(type)) { return new NoSpecimen(); } return this.supplier.create(); }
CustomBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if(request instanceof SeededRequest) { SeededRequest sr = (SeededRequest)request; request = sr.getRequest(); } if (!(request instanceof Type)) { return new NoSpecimen(); } Type type = (Type)request; if (!this.specimenType.equals(type)) { return new NoSpecimen(); } return this.supplier.create(); } }
CustomBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if(request instanceof SeededRequest) { SeededRequest sr = (SeededRequest)request; request = sr.getRequest(); } if (!(request instanceof Type)) { return new NoSpecimen(); } Type type = (Type)request; if (!this.specimenType.equals(type)) { return new NoSpecimen(); } return this.supplier.create(); } CustomBuilder(Type specimenType, SpecimenSupplier<? extends T> supplier);  CustomBuilder(SpecimenType specimenType, SpecimenSupplier<? extends T> supplier); }
CustomBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if(request instanceof SeededRequest) { SeededRequest sr = (SeededRequest)request; request = sr.getRequest(); } if (!(request instanceof Type)) { return new NoSpecimen(); } Type type = (Type)request; if (!this.specimenType.equals(type)) { return new NoSpecimen(); } return this.supplier.create(); } CustomBuilder(Type specimenType, SpecimenSupplier<? extends T> supplier);  CustomBuilder(SpecimenType specimenType, SpecimenSupplier<? extends T> supplier); @Override Object create(Object request, SpecimenContext context); }
CustomBuilder implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if(request instanceof SeededRequest) { SeededRequest sr = (SeededRequest)request; request = sr.getRequest(); } if (!(request instanceof Type)) { return new NoSpecimen(); } Type type = (Type)request; if (!this.specimenType.equals(type)) { return new NoSpecimen(); } return this.supplier.create(); } CustomBuilder(Type specimenType, SpecimenSupplier<? extends T> supplier);  CustomBuilder(SpecimenType specimenType, SpecimenSupplier<? extends T> supplier); @Override Object create(Object request, SpecimenContext context);  }