String (final String side, final int rowDelta, final int colDelta) { if (rowDelta == -1 && colDelta == 0) { return getAdjacentSide(side, BorderLayout.NORTH, BorderLayout.SOUTH); } if (rowDelta == 1 && colDelta == 0) { return getAdjacentSide(side, BorderLayout.SOUTH, BorderLayout.NORTH); } if (rowDelta == 0 && colDelta == -1) { return getAdjacentSide(side, BorderLayout.WEST, BorderLayout.EAST); } if (rowDelta == 0 && colDelta == 1) { return getAdjacentSide(side, BorderLayout.EAST, BorderLayout.WEST); } return null; }