### Question:
ResultSet { public static Map<String, Object> success(Collection<? extends Object> data) { Map<String, Object> returnMap = new HashMap<String, Object>(); returnMap.put("total", data == null ? 0 : data.size()); returnMap.put("data", data); returnMap.put("success", true); return returnMap; }  static Map<String, Object> success(Collection<? extends Object> data); static Map<String, Object> success(Object dataset); static Map<String, Object> error(String msg); static Map<String, Object> error(String errorMsg, Map additionalReturnValuesMap);  }### Answer:
@Test public void testSuccessWithSet() { Set<String> data = new HashSet<String>(); data.add("Humpty"); data.add("Dumpty"); Map<String, Object> resultSet = ResultSet.success(data); assertNotNull("Set does not become null", resultSet); makeSuccessFieldAssertions(resultSet, data); }
@Test public void testSuccessWithList() { List<String> data = Arrays.asList("foo", "bar", "baz"); Map<String, Object> resultSet = ResultSet.success(data); assertNotNull("List does not become null", resultSet); makeSuccessFieldAssertions(resultSet, data); }
@Test public void testSuccessWithSomeObject() { Object data = "I am an object!"; Map<String, Object> resultSet = ResultSet.success(data); assertNotNull("Object does not become null", resultSet); makeSuccessFieldAssertions(resultSet, data); }
@Test public void testSuccessWithNull() { Map<String, Object> resultSet = ResultSet.success(null); assertNotNull("'null' does not become null", resultSet); makeSuccessFieldAssertions(resultSet, null); }