MidnightTime { public static String log() { return "Hits: " + hits + " misses: " + misses + " stored: " + times.size(); }  static long calc(); static long calc(long time); static String log();  }
@Test public void log() { long now = DateUtil.now(); MidnightTime.calc(now); Assert.assertTrue(MidnightTime.log().startsWith("Hits:")); }