### Question:
TimestampPlugin extends Plugin { String generateTimestamp(int timestamp, ZoneId zoneId) { final ZonedDateTime time = ZonedDateTime.ofInstant( Instant.ofEpochSecond(timestamp), zoneId); return formatter.format(Date.from(time.toInstant())); }  @Provides TimestampConfig provideConfig(final ConfigManager configManager);  }### Answer:
@Test public void testGenerateTimestamp() { when(config.timestampFormat()).thenReturn("[yyyy:MM:dd:HH:hh:mm:ss]"); ConfigChanged configChanged = new ConfigChanged(); configChanged.setGroup("timestamp"); configChanged.setKey("format"); configChanged.setNewValue("true"); plugin.onConfigChanged(configChanged); int testInput = 1554667116; String testOutput = "[2019:04:07:15:03:58:36]"; TimeZone timeZone = TimeZone.getTimeZone("America/New_York"); plugin.getFormatter().setTimeZone(timeZone); assertEquals(plugin.generateTimestamp(testInput, timeZone.toZoneId()), testOutput); }