### Question:
LocalDateTimeMapper extends TypedMapper<LocalDateTime> { @Override protected LocalDateTime extractByIndex(final ResultSet r, final int index) throws SQLException { final Timestamp timestamp = r.getTimestamp(index); if (timestamp == null) { return null; } return timestamp.toLocalDateTime(); }    }### Answer:
@Test public void extractByIndex() throws Exception { when(resultSet.getTimestamp(1)).thenReturn(Timestamp.valueOf("2007-12-03 10:15:30.375")); LocalDateTime actual = new LocalDateTimeMapper().extractByIndex(resultSet, 1); assertThat(actual).isEqualTo(LocalDateTime.parse("2007-12-03T10:15:30.375")); }
@Test public void extractByIndex_TimestampIsNull() throws Exception { when(resultSet.getTimestamp(1)).thenReturn(null); LocalDateTime actual = new LocalDateTimeMapper().extractByIndex(resultSet, 1); assertThat(actual).isNull(); }