@Test public void testReturnsFrameFromGifDecoder() throws IOException { Bitmap expected = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_4444); when(gifDecoder.getNextFrame()).thenReturn(expected); assertEquals(expected, resourceDecoder.decode(gifDecoder, 100, 100).get()); }
@Override public Resource<Bitmap> decode(GifDecoder source, int width, int height) throws IOException { Bitmap bitmap = source.getNextFrame(); return new BitmapResource(bitmap, bitmapPool); }