private static void testBoxAddPosition(State state, Queue<State> nodes, Position player, int boxX, int boxY, int boxX2, int boxY2, Direction move, int index)
    {
        if (state.isFree(boxX, boxY) && state.isFree(boxX2, boxY2))
        {
            Position boxPos = state.boxes.get(index);
            Result result = Search.bfs(state, new IsAtPosition(move, boxPos.x, boxPos.y), player.x, player.y);
            if (result != null)
            {
                ArrayList<Position> boxes = new ArrayList<Position>(state.boxes);
                boxes.set(index, new Position(boxX, boxY));
                // Sort the boxes with a stable sort since we want that two configurations of boxes which are permutations
                // of each other are equal
                Collections.sort(boxes, comparePoints);
                State possibleStep = new State(state.map, new Position(boxX2, boxY2), boxes, result.path, state);
                Collections.reverse(possibleStep.playerPath);
                possibleStep.playerPath.add(move);

                if (!inHistory(possibleStep)){
                    nodes.add(possibleStep);
                }
            }
        }
    }