### Question:
ItemUtils { public static String convertAlbumEntityToJSON(Entity entity) throws JSONException { JSONObject entityJSON = new JSONObject(); entityJSON.put("title", entity.getTitle()); entityJSON.put("type", "album"); entityJSON.put("name", entity.getName()); return entityJSON.toString(); }  static Item parseJSONToItem(JSONObject jsonResult); static List<Item> parseJSONToMultipleItems(JSONObject jsonResult); static String convertAlbumEntityToJSON(Entity entity); static String convertPhotoEntityToJSON(Entity entity); static NameValuePair convertJSONStringToNameValuePair(String value); static String convertJsonResultToApiKey(String jsonResult); static String convertJsonStringToUrl(String jsonResult); static Integer getItemIdFromUrl(String createdAlbumUrl);  }### Answer:
@Test public void convertAlbumEntityToJSON() throws JSONException{ Entity albumEntity = new Entity(); albumEntity.setTitle("This is my Sample Album"); albumEntity.setName("Sample Album"); String convertEntityToJSON = ItemUtils.convertAlbumEntityToJSON(albumEntity); assertTrue("invalid JSON", new JSONObject(convertEntityToJSON) != null); assertTrue("missing title attribute", convertEntityToJSON.contains("\"title\":\"This is my Sample Album\"")); assertTrue("missing name attribute", convertEntityToJSON.contains("\"name\":\"Sample Album\"")); assertTrue("missing type attribute", convertEntityToJSON.contains("\"type\":\"album\"")); }