Program: 43079
Project: 43079
Buggy source:
/** 
 * Test getMaterial by world coordinates.
 */
public void testGetMaterialByCoord(){
  Grid grid=new ArrayGrid(1.0,0.4,0.5,0.05,0.01);
  grid.setData(0.0,0.0,0.0,Grid.OUTSIDE,(byte)3);
  grid.setData(0.95,0.39,0.45,Grid.EXTERIOR,(byte)2);
  grid.setData(0.6,0.1,0.4,Grid.INTERIOR,(byte)1);
  assertEquals("String_Node_Str",3,grid.getMaterial(0.0,0.0,0.0));
  assertEquals("String_Node_Str",2,grid.getMaterial(0.95,0.39,0.45));
  assertEquals("String_Node_Str",1,grid.getMaterial(0.6,0.1,0.4));
  grid=new ArrayGrid(0.12,0.11,0.16,0.05,0.02);
  grid.setData(0.06,0.07,0.08,Grid.INTERIOR,(byte)2);
  assertEquals("String_Node_Str",2,grid.getMaterial(0.05,0.06,0.05));
  assertEquals("String_Node_Str",2,grid.getMaterial(0.0999,0.06,0.05));
  assertEquals("String_Node_Str",2,grid.getMaterial(0.05,0.0799,0.05));
  assertEquals("String_Node_Str",2,grid.getMaterial(0.05,0.06,0.0999));
  assertEquals("String_Node_Str",2,grid.getMaterial(0.0999,0.0799,0.0999));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.0499,0.06,0.05));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.05,0.0599,0.05));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.05,0.06,0.0499));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.1,0.06,0.05));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.05,0.08,0.05));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.05,0.06,0.1));
  grid.setData(0.0,0.0,0.0,Grid.INTERIOR,(byte)5);
  assertEquals("String_Node_Str",5,grid.getMaterial(0.0,0.0,0.0));
  assertEquals("String_Node_Str",5,grid.getMaterial(0.0499,0.0,0.0));
  assertEquals("String_Node_Str",5,grid.getMaterial(0.0,0.0199,0.0));
  assertEquals("String_Node_Str",5,grid.getMaterial(0.0,0.0,0.0499));
  assertEquals("String_Node_Str",5,grid.getMaterial(0.0499,0.0199,0.0499));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.05,0.0,0.0));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.0,0.02,0.0));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.0,0.0,0.05));
  grid.setData(0.149,0.119,0.199,Grid.INTERIOR,(byte)12);
  assertEquals("String_Node_Str",12,grid.getMaterial(0.1,0.1,0.15));
  assertEquals("String_Node_Str",12,grid.getMaterial(0.149,0.1,0.15));
  assertEquals("String_Node_Str",12,grid.getMaterial(0.1,0.119,0.15));
  assertEquals("String_Node_Str",12,grid.getMaterial(0.1,0.1,0.199));
  assertEquals("String_Node_Str",12,grid.getMaterial(0.149,0.119,0.199));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.15,0.1,0.15));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.1,0.12,0.15));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.1,0.1,0.2));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.15,0.12,0.2));
}

Fixed version (ground truth):
/** 
 * Test getMaterial by world coordinates.
 */
public void testGetMaterialByCoord(){
  Grid grid=new ArrayGrid(1.0,0.4,0.5,0.05,0.01);
  grid.setData(0.0,0.0,0.0,Grid.OUTSIDE,(byte)3);
  grid.setData(0.95,0.39,0.45,Grid.EXTERIOR,(byte)2);
  grid.setData(0.6,0.1,0.4,Grid.INTERIOR,(byte)1);
  assertEquals("String_Node_Str",3,grid.getMaterial(0.0,0.0,0.0));
  assertEquals("String_Node_Str",2,grid.getMaterial(0.95,0.39,0.45));
  assertEquals("String_Node_Str",1,grid.getMaterial(0.6,0.1,0.4));
  grid=new ArrayGrid(0.12,0.11,0.16,0.05,0.02);
  grid.setData(0.06,0.07,0.08,Grid.INTERIOR,(byte)2);
  assertEquals("String_Node_Str",2,grid.getMaterial(0.05,0.06,0.05));
  assertEquals("String_Node_Str",2,grid.getMaterial(0.0999,0.06,0.05));
  assertEquals("String_Node_Str",2,grid.getMaterial(0.05,0.0799,0.05));
  assertEquals("String_Node_Str",2,grid.getMaterial(0.05,0.06,0.0999));
  assertEquals("String_Node_Str",2,grid.getMaterial(0.0999,0.0799,0.0999));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.0499,0.06,0.05));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.05,0.0599,0.05));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.05,0.06,0.0499));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.1,0.06,0.05));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.05,0.08,0.05));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.05,0.06,0.1));
  grid.setData(0.0,0.0,0.0,Grid.INTERIOR,(byte)5);
  assertEquals("String_Node_Str",5,grid.getMaterial(0.0,0.0,0.0));
  assertEquals("String_Node_Str",5,grid.getMaterial(0.0499,0.0,0.0));
  assertEquals("String_Node_Str",5,grid.getMaterial(0.0,0.0199,0.0));
  assertEquals("String_Node_Str",5,grid.getMaterial(0.0,0.0,0.0499));
  assertEquals("String_Node_Str",5,grid.getMaterial(0.0499,0.0199,0.0499));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.05,0.0,0.0));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.0,0.02,0.0));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.0,0.0,0.05));
  grid.setData(0.149,0.119,0.199,Grid.INTERIOR,(byte)12);
  assertEquals("String_Node_Str",12,grid.getMaterial(0.1499,0.1,0.1501));
  assertEquals("String_Node_Str",12,grid.getMaterial(0.1,0.119,0.1501));
  assertEquals("String_Node_Str",12,grid.getMaterial(0.1,0.1,0.199));
  assertEquals("String_Node_Str",12,grid.getMaterial(0.1499,0.1199,0.1999));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.0999,0.1,0.1501));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.1,0.0999,0.1501));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.1,0.1,0.1499));
  assertEquals("String_Node_Str",0,grid.getMaterial(0.0999,0.0999,0.1499));
}