private Solution createSolution(Node step, Set<Node> foundNodes, Queue<Node> stepPath) {
        List<Node> solutionPath = new ArrayList<>();
        Node currentStep = step;
        while ( currentStep != null ) {
            solutionPath.add(currentStep);
            currentStep = currentStep.getPrevStep();
        }

        return new Solution(solutionPath, stepPath.size(), foundNodes.size());
    }