### Question:
SamplesResource { @POST @Timed public Response writeSamples(Collection<SampleDTO> samples) { m_sampleRepository.insert(Transform.samples(samples)); return Response.status(Response.Status.CREATED).build(); } SamplesResource(SampleRepository sampleRepository,
                           Indexer indexer); @POST @Timed Response writeSamples(Collection<SampleDTO> samples); @GET @Timed @Path("/{resource}") Collection<Collection<SampleDTO>> getSamples(@PathParam("resource") Resource resource,
            @QueryParam("start") Optional<TimestampParam> start, @QueryParam("end") Optional<TimestampParam> end,
            @QueryParam("context") Optional<String> contextId); @DELETE @Timed @Path("/{resource}") void deleteSamples(@PathParam("resource") Resource resource,
                              @QueryParam("context") Optional<String> contextId);  }### Answer:
@Test public void testWriteSamples() { Response response = m_resource.writeSamples(Collections.<SampleDTO> emptyList()); assertThat(response.getStatus(), equalTo(Response.Status.CREATED.getStatusCode())); verify(m_repository).insert(anyCollectionOf(Sample.class)); }