public static Bitmap createForSize(int size, Bitmap.Config config) {
    Preconditions.checkArgument(size % BitmapUtil.getPixelSizeForBitmapConfig(config) == 0);
    return create(1, size / BitmapUtil.getPixelSizeForBitmapConfig(config), config);
  }
Helper class for creating bitmap mocks in tests.
imagepipeline-test/src/main/java/com/facebook/imagepipeline/testing/MockBitmapFactory.java