ImageLoader loader = new ImageLoader(); ImageData data1 = loader.load(stream)[0];
ImageData data1 = new ImageData(stream);
public void test_clone() {	InputStream stream = null;	try {		stream = SwtTestCase.class.getResourceAsStream(SwtTestCase.imageFilenames[0] + "." + SwtTestCase.imageFormats[0]);		ImageLoader loader = new ImageLoader();		ImageData data1 = loader.load(stream)[0];		ImageData data2 = (ImageData) data1.clone();		// imageData does not implement an equals(Object) method		assertEquals(":a:", data1.alpha, data2.alpha);		assertEquals(":b:", data1.alphaData, data2.alphaData);		assertEquals(":c:", data1.bytesPerLine, data2.bytesPerLine);		assertEquals(":d:", data1.data, data2.data);		assertEquals(":e:", data1.delayTime, data2.delayTime);		assertEquals(":f:", data1.depth, data2.depth);		assertEquals(":g:", data1.disposalMethod, data2.disposalMethod);		assertEquals(":h:", data1.height, data2.height);		assertEquals(":i:", data1.maskData, data2.maskData);		assertEquals(":j:", data1.maskPad, data2.maskPad);		assertEquals(":k:", data1.palette, data2.palette);		assertEquals(":l:", data1.scanlinePad, data2.scanlinePad);		assertEquals(":m:", data1.transparentPixel, data2.transparentPixel);		assertEquals(":n:", data1.type, data2.type);		assertEquals(":o:", data1.width, data2.width);		assertEquals(":p:", data1.x, data2.x);		assertEquals(":q:", data1.y, data2.y);	} finally {		try {			stream.close();		} catch (Exception e) {		}	}}