@Test public void request_class_equals_base_class_passes_sub_class_to_context() { builder.create(List.class, mockContext); verify(mockContext).resolve(ArrayList.class); }
@Override public Object create(Object request, SpecimenContext context) { if (!request.equals(baseClass)) { return new NoSpecimen(); } return context.resolve(this.subClass); }
SubTypeRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!request.equals(baseClass)) { return new NoSpecimen(); } return context.resolve(this.subClass); } }
SubTypeRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!request.equals(baseClass)) { return new NoSpecimen(); } return context.resolve(this.subClass); } SubTypeRelay(Class baseClass, Class subClass); }
SubTypeRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!request.equals(baseClass)) { return new NoSpecimen(); } return context.resolve(this.subClass); } SubTypeRelay(Class baseClass, Class subClass); @Override Object create(Object request, SpecimenContext context); }
SubTypeRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!request.equals(baseClass)) { return new NoSpecimen(); } return context.resolve(this.subClass); } SubTypeRelay(Class baseClass, Class subClass); @Override Object create(Object request, SpecimenContext context);  }