Excerpt from a brute force Rubik's Cube algorithm I have a program that brute force searches for a combination of inputted array elements by the user and when the program is searching all the for loops are nested for the brute search then I have this test() which looks is responsible for testing out all the possible combinations of the nested for loop to find the the combination entered by the user of the program, how ever the code is super redundant, here is a sample. 

public static boolean test(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k){
    boolean result1 = true;


    if(a == 0){
        cube = turn_U(cube);
    }
    else if(a == 1){
        cube = turn_Ui(cube);
    }
    else if(a == 2){
        cube = turn_U2(cube);
    }
    else if(a == 3){
        cube = turn_L(cube);
    }
    else if(a == 4){
        cube = turn_Li(cube);
    }
    else if(a == 5){
        cube = turn_L2(cube);
    }
    else if(a == 6){
        cube = turn_F(cube);
    }
    else if(a == 7){
        cube = turn_Fi(cube);
    }
    else if(a == 8){
        cube = turn_F2(cube);
    }
    else if(a == 9){
        cube = turn_R(cube);
    }
    else if(a == 10){
        cube = turn_Ri(cube);
    }
    else if(a == 11){
        cube = turn_R2(cube);
    }
    else if(a == 12){
        cube = turn_B(cube);
    }
    else if(a == 13){
        cube = turn_Bi(cube);
    }
    else if(a == 14){
        cube = turn_B2(cube);
    }
    else if(a == 15){
        cube = turn_D(cube);
    }
    else if(a == 16){
        cube = turn_Di(cube);
    }
    else if(a == 17){
        cube = turn_D2(cube);
    }


This is what happens for letters a through k and I was wondering how I could shorten this, I had an idea where I could make a method that selects a turn method based on the letter in the test() , this would reduce so that test has 11 calls to the method instead of the all of this repeated ones.
when the program is searching all the for loops are nested for the brute search


That sounds like the first thing to fix. The brute force search should use recursion or an iterative approach which builds up a data structure (a stack or queue).


  then I have this test() which looks is responsible for testing out all the possible combinations of the nested for loop to find the the combination entered by the user of the program


Each of the six basic moves is a permutation. They could be represented as a two-dimensional array, and then a single method could apply an appropriate one by selecting the appropriate permutation from the array.

Moreover, the expanded moves are just iteration, and implementing them as iteration will give you much cleaner code.

public void applyMove(int move) {
    int iterations = (move % 3) + 1;
    int basicMove = move / 3;
    while (iterations-- &gt; 0) {
        applyBasicMove(basicMove);
    }
}

public void applyBasicMove(int basicMove) {
    int[] permutation = basicPermutations[basicMove];
    ...
}


If you were worried about performance (which you clearly aren't, given that you're using a brute force search across a group of about \$4 \times 10^{19}\$ elements), you could optimise slightly by pre-computing the powers \$F^2\$ and \$F^3\$ (i.e. \$F^{-1}\$, or Fi if you prefer).