### Question:
MultipleSpecimenRelay implements SpecimenBuilder { @Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof MultipleRequest)) { return new NoSpecimen(); } MultipleRequest multipleRequest = (MultipleRequest) request; return buildArrayList(multipleRequest, context); } MultipleSpecimenRelay(MultipleCount multipleCount); @Override Object create(Object request, SpecimenContext context);  }### Answer:
@Test public void non_multiple_request_type_returns_no_specimen(){ Object result = this.relay.create(String.class, this.mockSpecimenContext); assertEquals(new NoSpecimen(), result); }
@Test public void calls_context_with_inner_request_time_n_times() { this.relay.create(new MultipleRequest(String.class), this.mockSpecimenContext); verify(this.mockSpecimenContext, times(this.count.getCount())).resolve(String.class); }
@Test public void returns_no_specimen_if_context_returns_no_specimen() { when(mockSpecimenContext.resolve(String.class)).thenReturn(new NoSpecimen()); Object result = this.relay.create(new MultipleRequest(String.class), this.mockSpecimenContext); assertEquals(new NoSpecimen(), result); }
@Test public void returns_array_list_of_resolved_types() { when(mockSpecimenContext.resolve(String.class)).thenReturn("a").thenReturn("b").thenReturn("c"); Object result = this.relay.create(new MultipleRequest(String.class), this.mockSpecimenContext); assertTrue(result instanceof ArrayList); assertEquals(count.getCount(), ((ArrayList) result).size()); assertEquals("a", ((ArrayList) result).get(0)); assertEquals("b", ((ArrayList)result).get(1)); assertEquals("c", ((ArrayList)result).get(2)); }