### Question:
ImageModeHelper { @Nullable public static String getAreaProviderProperty(final Properties properties) { return getAreaProviderProperty(new StringPropertyAdapter(properties)); } private  ImageModeHelper(); @Nullable static String getAreaProviderProperty(final Properties properties); @Nullable static String getAreaProviderProperty(@Nonnull final Map<String, String> properties); @Nullable static String getAreaProviderProperty(@Nullable final String imageModeProperty); @Nullable static String getRenderStrategyProperty(final Properties properties); @Nullable static String getRenderStrategyProperty(@Nonnull final Map<String, String> properties); @Nullable static String getRenderStrategyProperty(@Nullable final String imageModeProperty);  }### Answer:
@Test public void testGetAreaProviderPropertyExtractsNormalImageMode() { String areaProviderProperty = ImageModeHelper.getAreaProviderProperty(m_normalProperties); assertEquals(areaProviderProperty, "fullimage"); verify(m_normalProperties); }
@Test public void testGetAreaProviderPropertyExtractsResizeImageMode() { String renderStrategyProperty = ImageModeHelper.getAreaProviderProperty(m_resizeProperties); assertEquals(renderStrategyProperty, "fullimage"); verify(m_resizeProperties); }
@Test public void testGetAreaProviderPropertyExtractsSubImageImageMode() { String renderStrategyProperty = ImageModeHelper.getAreaProviderProperty(m_subImageProperties); assertEquals(renderStrategyProperty, "subimage:0,1,2,3"); verify(m_resizeProperties); }
@Test public void testGetAreaProviderPropertyExtractsRepeatImageMode() { String renderStrategyProperty = ImageModeHelper.getAreaProviderProperty(m_repeatProperties); assertEquals(renderStrategyProperty, "subimage:0,1,2,3"); verify(m_resizeProperties); }
@Test public void testGetAreaProviderPropertyExtractsSpriteImageMode() { String renderStrategyProperty = ImageModeHelper.getAreaProviderProperty(m_spriteProperties); assertEquals(renderStrategyProperty, "sprite:0,1,2"); verify(m_resizeProperties); }
@Test public void testGetAreaProviderPropertyExtractsSpriteResizeImageMode() { String renderStrategyProperty = ImageModeHelper.getAreaProviderProperty(m_spriteResizeProperties); assertEquals(renderStrategyProperty, "sprite:0,1,2"); verify(m_resizeProperties); }
@Test public void testGetAreaProviderPropertyReturnsImageAreaPropertyWhenFound() { Properties properties = createMock(Properties.class); expect(properties.getProperty("imageMode")).andReturn(null); expect(properties.getProperty("imageArea")).andReturn("dummy:foo"); replay(properties); assertEquals(ImageModeHelper.getAreaProviderProperty(properties), "dummy:foo"); verify(properties); }
@Test public void testGetAreaProviderPropertyReturnsNullWithUnknownProperty() { Properties properties = createMock(Properties.class); expect(properties.getProperty("imageMode")).andReturn(null); expect(properties.getProperty("imageArea")).andReturn(null); replay(properties); assertNull(ImageModeHelper.getAreaProviderProperty(properties)); verify(properties); }
@Test public void testGetAreaProviderPropertyReturnsNullWithUnknownImageMode() { Properties properties = createMock(Properties.class); expect(properties.getProperty("imageMode")).andReturn("blah:1,2,3"); expect(properties.getProperty("imageArea")).andReturn(null); replay(properties); assertNull(ImageModeHelper.getAreaProviderProperty(properties)); verify(properties); }