### Question:
KnownItems extends AbstractALSResource { @GET @Path("{userID}") @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) public Collection<String> get(@PathParam("userID") String userID) throws OryxServingException { return getALSServingModel().getKnownItems(userID); }  @GET @Path("{userID}") @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) Collection<String> get(@PathParam("userID") String userID);  }### Answer:
@Test public void testKnownItems() { List<String> items = target("/knownItems/U1").request() .accept(MediaType.APPLICATION_JSON_TYPE).get(LIST_STRING_TYPE); Assert.assertEquals(5, items.size()); for (int i : new int[] {1, 4, 5, 7, 8}) { OryxTest.assertContains(items, "I" + i); } }
@Test public void testKnownItemsCSV() { String response = target("/knownItems/U1").request().get(String.class); List<String> items = Arrays.asList(response.split("\n")); Assert.assertEquals(5, items.size()); for (int i : new int[] {1, 4, 5, 7, 8}) { OryxTest.assertContains(items, "I" + i); } }
@Test public void testEmptyItems() { List<String> items = target("/knownItems/X1").request() .accept(MediaType.APPLICATION_JSON_TYPE).get(LIST_STRING_TYPE); Assert.assertEquals(0, items.size()); }