### Question:
StatisticRdbRepository { public boolean add(final TaskResultStatistics taskResultStatistics) { boolean result = false; String sql = "INSERT INTO `" + TABLE_TASK_RESULT_STATISTICS + "_" + taskResultStatistics.getStatisticInterval() + "` (`success_count`, `failed_count`, `statistics_time`, `creation_time`) VALUES (?, ?, ?, ?);"; try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql)) { preparedStatement.setInt(1, taskResultStatistics.getSuccessCount()); preparedStatement.setInt(2, taskResultStatistics.getFailedCount()); preparedStatement.setTimestamp(3, new Timestamp(taskResultStatistics.getStatisticsTime().getTime())); preparedStatement.setTimestamp(4, new Timestamp(taskResultStatistics.getCreationTime().getTime())); preparedStatement.execute(); result = true; } catch (final SQLException ex) { log.error("Insert taskResultStatistics to DB error:", ex); } return result; } StatisticRdbRepository(final DataSource dataSource); boolean add(final TaskResultStatistics taskResultStatistics); boolean add(final TaskRunningStatistics taskRunningStatistics); boolean add(final JobRunningStatistics jobRunningStatistics); boolean add(final JobRegisterStatistics jobRegisterStatistics); List<TaskResultStatistics> findTaskResultStatistics(final Date from, final StatisticInterval statisticInterval); TaskResultStatistics getSummedTaskResultStatistics(final Date from, final StatisticInterval statisticInterval); Optional<TaskResultStatistics> findLatestTaskResultStatistics(final StatisticInterval statisticInterval); List<TaskRunningStatistics> findTaskRunningStatistics(final Date from); List<JobRunningStatistics> findJobRunningStatistics(final Date from); Optional<TaskRunningStatistics> findLatestTaskRunningStatistics(); Optional<JobRunningStatistics> findLatestJobRunningStatistics(); List<JobRegisterStatistics> findJobRegisterStatistics(final Date from); Optional<JobRegisterStatistics> findLatestJobRegisterStatistics();  }### Answer:
@Test public void assertAddTaskResultStatistics() { for (StatisticInterval each : StatisticInterval.values()) { Assert.assertTrue(repository.add(new TaskResultStatistics(100, 0, each, new Date()))); } }
@Test public void assertAddTaskRunningStatistics() { Assert.assertTrue(repository.add(new TaskRunningStatistics(100, new Date()))); }
@Test public void assertAddJobRunningStatistics() { Assert.assertTrue(repository.add(new TaskRunningStatistics(100, new Date()))); }
@Test public void assertAddJobRegisterStatistics() { Assert.assertTrue(repository.add(new JobRegisterStatistics(100, new Date()))); }
@Test public void assertAddTaskResultStatistics() { for (StatisticInterval each : StatisticInterval.values()) { assertTrue(repository.add(new TaskResultStatistics(100, 0, each, new Date()))); } }
@Test public void assertAddTaskRunningStatistics() { assertTrue(repository.add(new TaskRunningStatistics(100, new Date()))); }
@Test public void assertAddJobRunningStatistics() { assertTrue(repository.add(new TaskRunningStatistics(100, new Date()))); }
@Test public void assertAddJobRegisterStatistics() { assertTrue(repository.add(new JobRegisterStatistics(100, new Date()))); }