Code example for MapMaker

 * @author Dhanji R. Prasanna ( 
class InMemorySystemMetrics implements SystemMetrics { 
  private final ConcurrentMap<Class<?>, Metric> pages = new MapMaker().weakKeys().makeMap();
  private final AtomicBoolean active = new AtomicBoolean(false);
  private final Logger log = Logger.getLogger(SystemMetrics.class.getName());
  public void logPageRenderTime(Class<?> page, long time) {
    Metric metric = putIfAbsent(page);
    // Requests fight it out for who wins this set(). 
  public void logErrorsAndWarnings(Class<?> page, List<CompileError> errors, List<CompileError> warnings) {
    Metric metric = putIfAbsent(page);
Connect your IDE to all the code out there  Get Codota for Java