### Question:
BasicCollector extends Collector { @Override public GenericContainer collectMetrics() { KsqlVersionMetrics metricsRecord = new KsqlVersionMetrics(); metricsRecord.setTimestamp(timeUtils.nowInUnixTime()); metricsRecord.setConfluentPlatformVersion(Version.getVersion()); metricsRecord.setKsqlComponentType(moduleType.name()); return metricsRecord; } BasicCollector(KsqlModuleType moduleType, TimeUtils timeUtils); @Override GenericContainer collectMetrics();  }### Answer:
@Test public void testGetCollector() { BasicCollector basicCollector = new BasicCollector(moduleType, timeUtils); KsqlVersionMetrics expectedMetrics = new KsqlVersionMetrics(); expectedMetrics.setTimestamp(timeUtils.nowInUnixTime()); expectedMetrics.setConfluentPlatformVersion(Version.getVersion()); expectedMetrics.setKsqlComponentType(moduleType.name()); Assert.assertThat(basicCollector.collectMetrics(), CoreMatchers.equalTo(expectedMetrics)); }
@Test public void testCollectMetricsAssignsCurrentTime() { Long currentTimeSec = 1000l; mockClock.setCurrentTimeMillis(currentTimeSec * 1000); BasicCollector basicCollector = new BasicCollector(moduleType, timeUtils); currentTimeSec += 12300l; mockClock.setCurrentTimeMillis(currentTimeSec * 1000); KsqlVersionMetrics metrics = (KsqlVersionMetrics) basicCollector.collectMetrics(); assertEquals(currentTimeSec, metrics.getTimestamp()); currentTimeSec += 734l; mockClock.setCurrentTimeMillis(currentTimeSec * 1000); metrics = (KsqlVersionMetrics) basicCollector.collectMetrics(); assertEquals(currentTimeSec, metrics.getTimestamp()); }