GraphicsUtil { public static Image createImage(Class<? extends Icon> clazz, int imageWidth, int imageHeight) { return createImage(clazz, imageWidth, imageHeight, imageWidth, imageHeight, 0, 0); }  static Image createImage(Class<? extends Icon> clazz, int imageWidth, int imageHeight); static Image createImage(Class<? extends Icon> clazz, int imageWidth, int imageHeight, int canvasWidth,
	    int canvasHeight, int posX, int posY);  }
@Test public void testCreateImage_3args() { System.out.println("createImage"); Image result = GraphicsUtil.createImage(OecLogo.class, 200, 200); assertNotNull(result); result = GraphicsUtil.createImage(OecLogo.class, 150, 220); assertNotNull(result); result = GraphicsUtil.createImage(OecLogo.class, 370, 280); assertNotNull(result); result = GraphicsUtil.createImage(OecLogo.class, 400, 400); assertNotNull(result); result = GraphicsUtil.createImage(OecLogo.class, 1, 1); assertNotNull(result); try { GraphicsUtil.createImage(OecLogo.class, 0, 0); fail("IllegalArgumentException expected."); } catch (IllegalArgumentException ex) { } try { GraphicsUtil.createImage(OecLogo.class, -300, 0); fail("IllegalArgumentException expected."); } catch (IllegalArgumentException ex) { } try { GraphicsUtil.createImage(OecLogo.class, 0, -150); fail("IllegalArgumentException expected."); } catch (IllegalArgumentException ex) { } try { GraphicsUtil.createImage(OecLogo.class, -100, 30); fail("IllegalArgumentException expected."); } catch (IllegalArgumentException ex) { } try { GraphicsUtil.createImage(OecLogo.class, 50, -70); fail("IllegalArgumentException expected."); } catch (IllegalArgumentException ex) { } }
@Test public void testCreateImage_7args() { System.out.println("createImage"); Image result = GraphicsUtil.createImage(OecLogo.class, 100, 100, 200, 200, 25, 25); assertNotNull(result); result = GraphicsUtil.createImage(OecLogo.class, 150, 120, 260, 240, 0, 10); assertNotNull(result); result = GraphicsUtil.createImage(OecLogo.class, 200, 200, 100, 100, 0, 0); assertNotNull(result); result = GraphicsUtil.createImage(OecLogo.class, 200, 200, 400, 400, -300, -250); assertNotNull(result); result = GraphicsUtil.createImage(OecLogo.class, -10, -5, 100, 100, 20, 20); assertNotNull(result); try { GraphicsUtil.createImage(OecLogo.class, 50, 50, 0, 0, 0, 0); fail("IllegalArgumentException expected."); } catch (IllegalArgumentException ex) { } try { GraphicsUtil.createImage(OecLogo.class, -35, 17, -80, 0, 20, 20); fail("IllegalArgumentException expected."); } catch (IllegalArgumentException ex) { } try { GraphicsUtil.createImage(OecLogo.class, 100, 120, 0, -1, 0, 0); fail("IllegalArgumentException expected."); } catch (IllegalArgumentException ex) { } }