protected void addPossibleMovesInDirection(final List<Move> result,
            final int fileStep, final int fileBorder, final int rankStep,
            final int rankBorder) {
        // Catch the condition for infinite loops.
        // IMPROVE add additional sanity checking if necessary
        if (fileStep == 0 && rankStep == 0) {
            throw new IllegalArgumentException(
                    "Passing only zeros to the directional parameters would make this method run infinitely");
        }
        for (int file = this.getCoord().getFile(), rank = this.getCoord()
                .getRank(); file - fileStep != fileBorder
                && rank - rankStep != rankBorder; file += fileStep, rank += rankStep) {
            final Move possibleMove = defaultCorrectMoveTypeForValidCoord(Coords
                    .coord(file, rank));

            if (possibleMove != null) {
                result.add(possibleMove);
            }
            final Piece targetCoordPiece = pos.getPieceAt(file, rank);
            if (targetCoordPiece != null) {
                break;
            }

        }
    }