Rectangle imageBounds = image.getBounds(); imageWidth = imageBounds.width; 	treeItem2.setImage(0, image); imageHeight = tree2.getItemHeight() - tree2.getGridLineWidth();
public void test_getImageBoundsI() {/** * Test without item image */	Rectangle bounds;	Tree tree2 = new Tree(shell, SWT.CHECK);	TreeItem treeItem2 = new TreeItem(tree2, SWT.NULL);		assertEquals(new Rectangle(0, 0, 0, 0), treeItem.getImageBounds(-1));		// TODO - should this width be 0 or a value?	bounds = treeItem.getImageBounds(0);	assertTrue(":b:", bounds.width == 0);		assertEquals(new Rectangle(0, 0, 0, 0), treeItem.getImageBounds(1));		assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(-1));		// TODO - should this width be 0 or a value?	//bounds = treeItem2.getImageBounds(0);	//assertTrue(":e:", bounds.width == 0);		assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(1)); 	//	makeCleanEnvironment();		Image image = images[0];		int imageWidth = image.getBounds().width;	int imageHeight;		treeItem.setImage(0, image);	imageHeight = tree.getItemHeight() - tree.getGridLineWidth();	assertEquals(new Rectangle(0, 0, 0, 0), treeItem.getImageBounds(-1));		bounds = treeItem.getImageBounds(0);//	assertTrue(":b:", bounds.x > 0 && bounds.width == imageWidth && bounds.height == imageHeight);	// 	assertEquals(new Rectangle(0, 0, 0, 0), treeItem.getImageBounds(1));		//	makeCleanEnvironment();			tree2.dispose();	tree2 = new Tree(shell, SWT.CHECK);	treeItem2.dispose();	treeItem2 = new TreeItem(tree2, SWT.NULL);	Rectangle imageBounds = image.getBounds();	imageWidth = imageBounds.width; 	treeItem2.setImage(0, image);	imageHeight = tree2.getItemHeight() - tree2.getGridLineWidth();	assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(-1));		bounds = treeItem2.getImageBounds(0);	// bounds.width should be check box width if they are wider than image//	assertTrue(":b:", bounds.x > 0 && bounds.width > 0 && bounds.height == imageHeight);// 	assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(1));		//	makeCleanEnvironment();	tree2.dispose();	tree2 = new Tree(shell, SWT.CHECK);	treeItem2.dispose();	treeItem2 = new TreeItem(tree2, SWT.NULL);	image = images[1];	imageBounds = image.getBounds();	imageWidth = imageBounds.width; 	treeItem2.setImage(0, image);	imageHeight = tree2.getItemHeight() - tree2.getGridLineWidth();	assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(-1)); 	bounds = treeItem2.getImageBounds(0);	// bounds.width should be check box width if check box is wider than image//	assertTrue(":b:", bounds.x > 0 && bounds.width > 0 && bounds.height == imageHeight); 	assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(1));}