Board implements IBoard { @Override public Point getPosition(final IField field) { int tag = ((Field) field).getTag(); return new Point(tag / dimY, tag % dimY); } Board(final int dimX, final int dimY); private  Board(final BoardState state); @Override IField getField(final int x, final int y); @Override Point getDimension(); @Override int getFlagCount(); @Override int getOpenCount(); void openAllFlaggedOrBomb(); @Override String toString(); @Override Point getPosition(final IField field); @Override boolean isOverflagged(); boolean isExploded(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testGetPosition() { Point dimension = itsBoard.getDimension(); for (int i = 0; i < dimension.x; i++) for (int j = 0; j < dimension.y; j++) { IField field = itsBoard.getField(i, j); Point position = itsBoard.getPosition(field); assertEquals(i, position.x); assertEquals(j, position.y); } }