public static void main(String[] args) {
    System.out.println("Starting.");
    System.out.flush();
    try {
      FreshLRUCache cache1 = new FreshLRUCache(0, 3, 6);
      cache1.put(1, 2);
      try {
        Thread.sleep(10);
      } catch (InterruptedException ie) {}
      cache1.clearStaleEntries();
      if (cache1.size() != 1) {
        System.out.println("Cached entry was inapprorpriately cleared.");
        System.out.flush();
      } else {
        System.out.println("Cached entry was approrpriately not-cleared.");
        System.out.flush();
      }
      FreshLRUCache cache2 = new FreshLRUCache(5, 3, 6);
      cache2.put(1, 2);
      try {
        Thread.sleep(10);
      } catch (InterruptedException ie) {}
      cache2.clearStaleEntries();
      if (cache2.size() != 0) {
        System.out.println("Cached entry was inapprorpriately not-cleared.");
        System.out.flush();
      } else {
        System.out.println("Cached entry was approrpriately cleared.");
        System.out.flush();
      }
      cache2.put(2, 3);
      cache2.put(3, 4);
      cache2.put(4, 3);
      cache2.put(6, 4);
      cache2.put(7, 4);
      cache2.put(8, 4);
      if (cache2.size() > 6) {
        System.out.println("Cache grew inappropriately large.");
        System.out.flush();
      } else {
        System.out.println("Cache is approrpriate size.");
        System.out.flush();
      }
      FreshLRUCache cache3 = new FreshLRUCache(5, 3, 6);
      cache3.put(3, 2);
      try {
        Thread.sleep(10);
      } catch (InterruptedException ie) {}
      cache3.put(4, 5);
      if (cache3.size() != 1) {
        System.out.println("Cached entry was inapprorpriately not-cleared.");
        System.out.flush();
      } else {
        System.out.println("Cached entry was approrpriately cleared.");
        System.out.flush();
      }
    } catch (Exception e) {
      e.printStackTrace();
      System.err.flush();
    } finally {
      System.out.println("Finished.");
      System.out.flush();
      System.exit(0);
    }
  }