NoopWriter extends AbstractWriter implements BulkMessageWriter<JSONObject> { public NoopWriter withLatency(String sleepConfig) { sleepFunction = getSleepFunction(sleepConfig); return this; }  NoopWriter withLatency(String sleepConfig); @Override void configure(String sensorName, WriterConfiguration configuration); @Override void init(Map stormConf, WriterConfiguration config); @Override BulkWriterResponse write(String sensorType, WriterConfiguration configurations, List<BulkMessage<JSONObject>> messages); @Override String getName(); @Override void close();  }
@Test public void testFixedLatencyConfig() { NoopWriter writer = new NoopWriter().withLatency("10"); assertTrue(writer.sleepFunction instanceof NoopWriter.FixedLatency); NoopWriter.FixedLatency sleepFunction = (NoopWriter.FixedLatency)writer.sleepFunction; assertEquals(10, sleepFunction.getLatency()); }