### Question:
LocalDateMapper extends TypedMapper<LocalDate> { @Override protected LocalDate extractByName(ResultSet r, String name) throws SQLException { Timestamp timestamp = r.getTimestamp(name); if (timestamp == null) { return null; } return timestamp.toLocalDateTime().toLocalDate(); }    }### Answer:
@Test public void extractByName() throws Exception { when(resultSet.getTimestamp("name")).thenReturn(Timestamp.valueOf("2007-12-03 00:00:00.000")); LocalDate actual = new LocalDateMapper().extractByName(resultSet, "name"); assertThat(actual).isEqualTo(LocalDate.parse("2007-12-03")); }
@Test public void extractByName_TimestampIsNull() throws Exception { when(resultSet.getTimestamp("name")).thenReturn(null); LocalDate actual = new LocalDateMapper().extractByName(resultSet, "name"); assertThat(actual).isNull(); }