### Question:
ReEncodingGifResourceEncoder implements ResourceEncoder<GifDrawable> { @NonNull @Override public EncodeStrategy getEncodeStrategy(@NonNull Options options) { Boolean encodeTransformation = options.get(ENCODE_TRANSFORMATION); return encodeTransformation != null && encodeTransformation ? EncodeStrategy.TRANSFORMED : EncodeStrategy.SOURCE; } @SuppressWarnings("unused")  ReEncodingGifResourceEncoder(@NonNull Context context, @NonNull BitmapPool bitmapPool); @VisibleForTesting  ReEncodingGifResourceEncoder(Context context, BitmapPool bitmapPool, Factory factory); @NonNull @Override EncodeStrategy getEncodeStrategy(@NonNull Options options); @Override boolean encode(
      @NonNull Resource<GifDrawable> resource, @NonNull File file, @NonNull Options options); @SuppressWarnings("WeakerAccess")
  static final Option<Boolean> ENCODE_TRANSFORMATION; }### Answer:
@Test public void testEncodeStrategy_withEncodeTransformationTrue_returnsTransformed() { assertThat(encoder.getEncodeStrategy(options)).isEqualTo(EncodeStrategy.TRANSFORMED); }
@Test public void testEncodeStrategy_withEncodeTransformationUnSet_returnsSource() { options.set(ReEncodingGifResourceEncoder.ENCODE_TRANSFORMATION, null); assertThat(encoder.getEncodeStrategy(options)).isEqualTo(EncodeStrategy.SOURCE); }
@Test public void testEncodeStrategy_withEncodeTransformationFalse_returnsSource() { options.set(ReEncodingGifResourceEncoder.ENCODE_TRANSFORMATION, false); assertThat(encoder.getEncodeStrategy(options)).isEqualTo(EncodeStrategy.SOURCE); }