SpriteSheet { public Point getPointForIndex(int imageIndex) { int row = imageIndex / width; int column = imageIndex % width; return new Point(column * imageWidth, row * imageHeight); } SpriteSheet(Image spriteSheet, int width, int height, int duration);  SpriteSheet(int width, int height, Image spriteSheet, int imageWidth,
                       int imageHeight, int duration); static SpriteSheet CreateSpriteSheetFromTileRegister(String tileName, int width, int height, int duration); Point getPointForIndex(int imageIndex); void setImageHeight(int imageHeight); void setImageWidth(int imageWidth); int getWidth(); int getHeight(); int numberOfImages(); Image getSpriteSheet(); int getDuration(); int getImageHeight(); int getImageWidth();  }
@Test public void testGetPointForIndex() throws Exception { int tile = TileRegister.TILE_SIZE; SpriteSheet spriteSheet = new SpriteSheet(null, 2, 2, 100); assertEquals(new Point(0, 0), spriteSheet.getPointForIndex(0)); assertEquals(new Point(tile, 0), spriteSheet.getPointForIndex(1)); assertEquals(new Point(0, tile), spriteSheet.getPointForIndex(2)); assertEquals(new Point(tile, tile), spriteSheet.getPointForIndex(3)); }