@Test
public void testScale() {

  BufferedImage uut = ImageScaler.scale(img, ImageSizePreset.FULL.getSize());
  assertEquals(ImageSizePreset.FULL.getSize().getWidth(), uut.getWidth());
  assertEquals(ImageSizePreset.FULL.getSize().getHeight(), uut.getHeight());
  uut = ImageScaler.scale(img, ImageSizePreset.ICON.getSize());
  assertEquals(ImageSizePreset.ICON.getSize().getWidth(), uut.getWidth());
  assertEquals(ImageSizePreset.ICON.getSize().getHeight(), uut.getHeight());
  uut = ImageScaler.scale(img, 2.2);
  assertEquals((int) (widthBefore * 2.2), uut.getWidth());
  assertEquals((int) (heightBefore * 2.2), uut.getHeight());
  uut = ImageScaler.scale(img, 0.33);
  assertEquals((int) (widthBefore * 0.33), uut.getWidth());
  assertEquals((int) (heightBefore * 0.33), uut.getHeight());
  uut = ImageScaler.scale(img, 1.0);
  assertEquals(widthBefore, uut.getWidth());
  assertEquals(heightBefore, uut.getHeight());
  uut = ImageScaler.scale(img, 0.001);
  assertEquals(1, uut.getWidth());
  assertEquals(1, uut.getHeight());
  uut = ImageScaler.scale(img, 1.0, 2.5);
  assertEquals(widthBefore, uut.getWidth());
  assertEquals((int) (heightBefore * 2.5), uut.getHeight());
  uut = ImageScaler.scale(img, 2.5, 1.0);
  assertEquals((int) (widthBefore * 2.5), uut.getWidth());
  assertEquals(heightBefore, uut.getHeight());
  uut = ImageScaler.scale(img, 0.5, 4.0);
  assertEquals((int) (widthBefore * 0.5), uut.getWidth());
  assertEquals((int) (heightBefore * 4.0), uut.getHeight());
  uut = ImageScaler.scale(img, 4.0, 0.5);
  assertEquals((int) (widthBefore * 4.0), uut.getWidth());
  assertEquals((int) (heightBefore * 0.5), uut.getHeight());
  uut = ImageScaler.scale(img, 807);
  assertEquals(807, uut.getWidth());
  assertEquals(807, uut.getHeight());
  uut = ImageScaler.scale(img, 122);
  assertEquals(122, uut.getWidth());
  assertEquals(122, uut.getHeight());
  uut = ImageScaler.scale(img, widthBefore);
  assertEquals(widthBefore, uut.getWidth());
  assertEquals(widthBefore, uut.getHeight());
  uut = ImageScaler.scale(img, widthBefore, 654);
  assertEquals(widthBefore, uut.getWidth());
  assertEquals(654, uut.getHeight());
  uut = ImageScaler.scale(img, 654, heightBefore);
  assertEquals(654, uut.getWidth());
  assertEquals(heightBefore, uut.getHeight());
  uut = ImageScaler.scale(img, 111, 555);
  assertEquals(111, uut.getWidth());
  assertEquals(555, uut.getHeight());
  uut = ImageScaler.scale(img, 555, 111);
  assertEquals(555, uut.getWidth());
  assertEquals(111, uut.getHeight());
  uut = ImageScaler.scale(img, 1, 1);
  assertEquals(1, uut.getWidth());
  assertEquals(1, uut.getHeight());
}