### Question:
FieldRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof Field)) { return new NoSpecimen(); } Field field = (Field) request; Type genericType = field.getGenericType(); SpecimenType specimenType = SpecimenType.of(genericType); String fieldName = field.getName(); Object actualRequest = getActualRequest(field, specimenType); return context.resolve(new SeededRequest(fieldName, actualRequest)); } FieldRelay(RequestEnricher requestEnricher); @Override Object create(Object request, SpecimenContext context);  }### Answer:
@Test public void non_field_request_returns_no_specimen() { Object result = this.fieldBuilder.create(String.class, mockSpecimenContext); assertEquals(new NoSpecimen(), result); }
@Test public void field_request_provides_seeded_request_with_name_and_type_to_context() throws NoSuchFieldException { this.fieldBuilder.create(getIntField(), mockSpecimenContext); ArgumentCaptor<SeededRequest> argument = ArgumentCaptor.forClass(SeededRequest.class); verify(mockSpecimenContext).resolve(argument.capture()); SeededRequest request = argument.getValue(); assertEquals("intField", request.getSeed()); assertEquals(request.getRequest(), Integer.class); }
@Test public void field_request_returns_context_result_of_field_type() throws NoSuchFieldException { when(mockSpecimenContext.resolve(any(SeededRequest.class))).thenReturn(1); Object result = this.fieldBuilder.create(getIntField(), mockSpecimenContext); assertEquals(1, result); }