ImageFrame extends JFrame { public ImageFrame() { super(); this.panel = new ImagePanel(); this.getContentPane().add(this.panel); } ImageFrame(); ImageFrame useDefaultSettings(); ImageFrame setImage(final Image img); void setImg(final Img img); static ImageFrame display(final Image img); static ImageFrame display(final Img img); ImagePanel getPanel();  }
@Test public void imageFrameTest() { Img img1 = new Img(1, 1); Img img2 = new Img(2, 2); ImageFrame frame = ImageFrame.display(img1); Thread.yield(); frame.setImg(img2); frame.getPanel().setBackground(Color.cyan); frame.dispose(); }