@Override
  public void onNewResultImpl(DataSource<List<CloseableReference<CloseableImage>>> dataSource) {
    if (!dataSource.isFinished()) {
      return;
    }
    List<CloseableReference<CloseableImage>> imageRefList = dataSource.getResult();
    if (imageRefList == null) {
      onNewResultListImpl(null);
      return;
    }
    try {
      List<Bitmap> bitmapList = new ArrayList<>(imageRefList.size());
      for (CloseableReference<CloseableImage> closeableImageRef : imageRefList) {
        if (closeableImageRef != null && closeableImageRef.get() instanceof CloseableBitmap) {
          bitmapList.add(((CloseableBitmap) closeableImageRef.get()).getUnderlyingBitmap());
        } else {
          // This is so that client gets list with same length
          bitmapList.add(null);
        }
      }
      onNewResultListImpl(bitmapList);
    } finally {
      for (CloseableReference<CloseableImage> closeableImageRef : imageRefList) {
        CloseableReference.closeSafely(closeableImageRef);
      }
    }
  }
Implementation of {@link DataSubscriber} for cases where the client wants to access a list of
bitmaps.

<p>Sample usage: <code>
  dataSource.subscribe(
    new BaseListBitmapDataSubscriber() {
      @Override
      public void onNewResultImpl(@Nullable List<Bitmap> bitmapList) {
        // Pass bitmap list to system, which makes a copy of it.
        update(bitmapList);
        // No need to do any cleanup.
      }

      @Override
      public void onFailureImpl(DataSource dataSource) {
        // No cleanup required here.
      }
    }
</code>
imagepipeline/src/main/java/com/facebook/imagepipeline/datasource/BaseListBitmapDataSubscriber.java