### Question:
MostPopularItems extends AbstractALSResource { @GET @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) public List<IDCount> get(@DefaultValue("10") @QueryParam("howMany") int howMany, @DefaultValue("0") @QueryParam("offset") int offset, @QueryParam("rescorerParams") List<String> rescorerParams) throws OryxServingException { ALSServingModel model = getALSServingModel(); RescorerProvider rescorerProvider = model.getRescorerProvider(); Rescorer rescorer = null; if (rescorerProvider != null) { rescorer = rescorerProvider.getMostPopularItemsRescorer(rescorerParams); } return mapTopCountsToIDCounts(model.getItemCounts(), howMany, offset, rescorer); }  @GET @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) List<IDCount> get(@DefaultValue("10") @QueryParam("howMany") int howMany,
                           @DefaultValue("0") @QueryParam("offset") int offset,
                           @QueryParam("rescorerParams") List<String> rescorerParams);  }### Answer:
@Test public void testMostPopular() { List<IDCount> top = target("/mostPopularItems").request() .accept(MediaType.APPLICATION_JSON_TYPE).get(LIST_ID_COUNT_TYPE); testTopCount(9, top); Assert.assertEquals(6, top.get(0).getCount()); Assert.assertEquals(6, top.get(1).getCount()); }
@Test public void testMostPopularCSV() { String response = target("/mostPopularItems").request().get(String.class); testCSVTopByCount(9, response); }
@Test public void testRescorer() { List<IDCount> top = target("/mostPopularItems").queryParam("rescorerParams", "foo").request() .accept(MediaType.APPLICATION_JSON_TYPE).get(LIST_ID_COUNT_TYPE); Assert.assertEquals(4, top.size()); Assert.assertEquals(6, top.get(0).getCount()); Assert.assertEquals(5, top.get(1).getCount()); }