### Question:
ProviderAPI extends RestAbstract { @GET @Path("/") @Produces(CONTENT_TYPE_JSON + ";qs=.5") public Response getProvidersJSON() { logger.info("GET / [JSON]"); String jsonRepresentation = Converter.getRootCollectionJSON(getProvidersFromDB()); logger.debug("RESPONSE: " + jsonRepresentation); return buildResponse(Status.OK, jsonRepresentation); }  @GET @Path("/") @Produces(CONTENT_TYPE_XML + ";qs=1") Response getProviders(); @GET @Path("/") @Produces(CONTENT_TYPE_JSON + ";qs=.5") Response getProvidersJSON(); @GET @Path("/{id}") @Produces(CONTENT_TYPE_XML + ";qs=1") Response getProvider(@PathParam("id") int id); @GET @Path("/{id}") @Produces(CONTENT_TYPE_JSON + ";qs=.5") Response getProviderJSON(@PathParam("id") int id); @POST @Path("/") @Consumes(CONTENT_TYPE_XML) @Produces(CONTENT_TYPE_XML) Response postProvider(String payload); @DELETE @Path("/{id}") Response deleteProvider(@PathParam("id") int id); @PUT @Path("/{id}") @Consumes(CONTENT_TYPE_XML) @Produces(CONTENT_TYPE_XML) Response putProvider(@PathParam("id") int id, String payload);  }### Answer:
@Test public void getProvidersJSONTest() throws ParseException { ProviderAPI providerAPI = new ProviderAPI(); providerAPI.providerDAO = providerDAO; Response response = providerAPI.getProvidersJSON(); assertEquals(200, response.getStatus()); String providersJSON = (String) response.getEntity(); JSONParser parser = new JSONParser(); Object obj = parser.parse(providersJSON); JSONObject jsonObject = (JSONObject) obj; jsonObject = (JSONObject) jsonObject.get("items"); JSONArray providersArray = (JSONArray) jsonObject.get("provider"); jsonObject = (JSONObject) providersArray.get(0); assertEquals("Provider 1", jsonObject.get("name")); jsonObject = (JSONObject) providersArray.get(1); assertEquals("Provider 2", jsonObject.get("name")); }