### Question:
Converter { public static String getRootCollectionJSON(List<Provider> providers) { Collection collection = prepareCollection(providers); return toJSON(Collection.class, collection); }  static Provider getProviderObject(String xml); static String getProviderXML(Provider provider); static String getRootCollectionJSON(List<Provider> providers); static String getRootCollectionXML(List<Provider> providers); static String getProviderJSON(Provider provider); static Provider getProviderFromJSON(String json);  }### Answer:
@Test public void getCollectionJSONTest() throws Exception { List<Provider> providers = new ArrayList<Provider>(); Provider provider1 = new Provider(); provider1.setId(1); provider1.setName("provider1"); provider1.setVmmUrl("http: providers.add(provider1); Provider provider2 = new Provider(); provider2.setId(2); provider2.setName("provider2"); provider2.setVmmUrl("http: providers.add(provider2); String json = Converter.getRootCollectionJSON(providers); System.out.println(json); JSONParser parser = new JSONParser(); Object obj = parser.parse(json); JSONObject jsonObject = (JSONObject) obj; jsonObject = (JSONObject) jsonObject.get("items"); JSONArray providersArray = (JSONArray) jsonObject.get("provider"); jsonObject = (JSONObject) providersArray.get(0); assertEquals("provider1", jsonObject.get("name")); jsonObject = (JSONObject) providersArray.get(1); assertEquals("provider2", jsonObject.get("name")); }