### Question:
ResultSet { public static Map<String, Object> error(String msg) { Map<String, Object> returnMap = new HashMap<String, Object>(); returnMap.put("message", msg); returnMap.put("success", false); 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 testErrorWithMessage() { Map<String, Object> resultSet = ResultSet.error("My error message"); assertNotNull("Message does not become null", resultSet); makeErrorFieldAssertions(resultSet); }
@Test public void testErrorWithMessageAndAdditionalInfo() { final String additionalInfoKey = "additionalInfo"; final String testKey = "foo"; final String testValue = "bar"; final Map<String, Object> testMap = new HashMap<>(); testMap.put(testKey, testValue); Map<String, Object> resultSet = ResultSet.error("My error message", testMap); assertNotNull("Result does not become null", resultSet); makeErrorFieldAssertions(resultSet); final Object additionalInfoMapObj = resultSet.get(additionalInfoKey); assertNotNull("Value for key '" + additionalInfoKey + "' is defined", additionalInfoMapObj); assertTrue("Additional info is an instance of map", additionalInfoMapObj instanceof Map); final Map additionalInfoMap = (Map) additionalInfoMapObj; assertEquals("Provided additional info matches returned one", additionalInfoMap.get(testKey), testValue); }