@Override
  public synchronized Bitmap getBitmapForReuse(Tile tile) {
    if (mMap.isEmpty()) {
      return null;
    }
    BitmapFactory.Options options = tile.getMeasureOptions();
    Iterator<Bitmap> iterator = mMap.values().iterator();
    while (iterator.hasNext()) {
      Bitmap candidate = iterator.next();
      if (candidate == null) {
        break;
      }
      if (qualifies(candidate, options)) {
        iterator.remove();
        mSize -= sizeOf(candidate);
        candidate.eraseColor(Color.BLACK);
        return candidate;
      }
    }
    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