@Override
  public synchronized Bitmap remove(String key) {
    if (mMap.containsKey(key)) {
      Bitmap bitmap = mMap.get(key);
      mSize -= sizeOf(bitmap);
      mMap.remove(key);
      return bitmap;
    }
    return null;
  }
Implementation of LRU cache (String to Bitmap) with a method to grab the oldest Bitmap.
tileview/src/main/java/com/moagrius/tileview/MemoryCache.java