### Question:
PersonRowMapper implements RowMapper { public Object mapRow(ResultSet rs, int rowNum) throws SQLException { return new Person(rs.getString("first_name"), rs .getString("last_name")); }  Object mapRow(ResultSet rs, int rowNum);  }### Answer:
@Test public void testMappingRow() throws Exception { Person expected = new Person("John", "Doe"); Map<String, Object> data = new HashMap<String, Object>(); data.put("first_name", expected.getFirstname()); data.put("last_name", expected.getLastname()); MockSingleRowResultSet rs = new MockSingleRowResultSet(); rs.addExpectedNamedValues(data); RowMapper mapper = new PersonRowMapper(); assertEquals(expected, mapper.mapRow(rs, 1)); }