DurationInfo extends OperationDuration implements AutoCloseable { @Override public void close() { finished(); if (logAtInfo) { log.info("{}", this); } else { if (log.isDebugEnabled()) { log.debug("{}", this); } } } DurationInfo(Logger log, String format, Object... args);  DurationInfo(Logger log,
      boolean logAtInfo,
      String format,
      Object... args); @Override String toString(); @Override void close();  }
@Test public void testDurationInfoWithMultipleClose() throws Exception { DurationInfo info = new DurationInfo(log, "test"); Thread.sleep(1000); info.close(); info.close(); Assert.assertTrue(info.value() > 0); }
@Test(expected = NullPointerException.class) public void testDurationInfoCreationWithNullMsg() { DurationInfo info = new DurationInfo(log, null); info.close(); }