Code example for HashSet

Methods: containsremove

    public boolean setBitmap(Bitmap bitmap, int index, int token) {
        // Ignore results from previous requests 
        if (token != mGeneration) {
            return false; 
        if (!mPending.contains(index)) {
            Log.e(TAG, "received unasked bitmap, index = " + index);
            return false; 
        if (bitmap == null) {
            Log.w(TAG, "receive null bitmap for index = " + index);
            // We keep this request in mPending, so we won't request it again. 
            return false; 
        ThumbnailKey key = new ThumbnailKey(mMediaItem.getId(), index);
        sThumbnailCache.put(key, bitmap);
        return true; 
Connect your IDE to all the code out there  Get Codota for Java