LongCache { @Override public String toString() { return "LongCache{cache=" + cache + '}'; } LongCache(int maxSize); long getOrCompute(K key, LongSupplier compute); @Override String toString();  }
@Test void testToString() { final LongCache<String> lc = new LongCache<>(10); final long actual = lc.getOrCompute("Olle", () -> 42L); assertTrue(lc.toString().contains("Olle")); assertTrue(lc.toString().contains("42")); }