@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)); }
@Override public Object create(Object request, SpecimenContext context) { if (!(request instanceof MultipleRequest)) { return new NoSpecimen(); } MultipleRequest multipleRequest = (MultipleRequest) request; return buildArrayList(multipleRequest, context); }
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 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); }
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); }
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);  }