### Question:
NamedTransformImageServlet extends SlingSafeMethodsServlet implements OptingServlet { protected boolean isProgressiveJpeg(final String mimeType, final ValueMap transforms) { boolean enabled = transforms.get("enabled", false); if (enabled) { if ("image/jpeg".equals(mimeType) || "image/jpg".equals(mimeType)) { return true; } else { log.debug("Progressive encoding is only supported for JPEGs. Mime type: {}", mimeType); return false; } } else { return false; } }  @Override final boolean accepts(final SlingHttpServletRequest request); static final String NAME_IMAGE; static final String NAMED_IMAGE_FILENAME_PATTERN; static final String DEFAULT_FILENAME_PATTERN; static final String RT_LOCAL_SOCIAL_IMAGE; static final String RT_REMOTE_SOCIAL_IMAGE; }### Answer:
@Test public void test_isProgressiveJpeg() { ValueMap progressiveTransforms = new ValueMapDecorator(new HashMap<String, Object>()); progressiveTransforms.put("enabled", false); assertFalse(servlet.isProgressiveJpeg("image/png", progressiveTransforms)); progressiveTransforms.put("enabled", false); assertFalse(servlet.isProgressiveJpeg("image/jpg", progressiveTransforms)); progressiveTransforms.put("enabled", false); assertFalse(servlet.isProgressiveJpeg("image/jpeg", progressiveTransforms)); progressiveTransforms.put("enabled", true); assertFalse(servlet.isProgressiveJpeg("image/png", progressiveTransforms)); progressiveTransforms.put("enabled", true); assertTrue(servlet.isProgressiveJpeg("image/jpg", progressiveTransforms)); progressiveTransforms.put("enabled", true); assertTrue(servlet.isProgressiveJpeg("image/jpeg", progressiveTransforms)); progressiveTransforms.put("enabled", true); assertFalse(servlet.isProgressiveJpeg(null, progressiveTransforms)); progressiveTransforms.put("enabled", true); assertFalse(servlet.isProgressiveJpeg("", progressiveTransforms)); progressiveTransforms.remove("enabled"); assertFalse(servlet.isProgressiveJpeg("", progressiveTransforms)); }