private static List<Pair> getAllNeighbour(Pair source, int [][] maze) {
        List<Pair> neighbours = new ArrayList<>();
        if(source.y - 1 >= 0 && maze[source.x][source.y-1] != 1 ) {
            neighbours.add(new Pair(source.x, source.y-1, maze[source.x][source.y-1]));
        }
        if(source.x - 1 >= 0 && maze[source.x-1][source.y] != 1 ) {
            neighbours.add(new Pair(source.x-1, source.y,maze[source.x-1][source.y]));
        }
        if(source.y + 1 < maze[0].length && maze[source.x][ source.y+1] != 1) {
            neighbours.add(new Pair(source.x, source.y+1, maze[source.x][ source.y+1]));
        }
        if(source.x + 1 < maze.length && maze[source.x+1][source.y] != 1) {
            neighbours.add(new Pair(source.x+1, source.y, maze[source.x+1][source.y]));
        }
        return neighbours;
    }