Java Spintax All Combinations

Does someone know how to output all spintax combinations (for e.g. in a string array) without a random combination? I didn’t get it working. The code below shared by an another stackoverflow member is just returning a single random spintax combination of an input string. The number paramter is just for seeding a random combination.

Java Method:

static String Spintax(int number,String str)
    Random rnd = new Random(number); 
    String pat = "\\{[^{}]*\\}";
    Pattern ma; 
    ma = Pattern.compile(pat);
    Matcher mat = ma.matcher(str);
        String segono = str.substring(mat.start() + 1,mat.end() - 1);
        String[] choies = segono.split("\\|",-1);
        str = str.substring(0, mat.start()) + choies[rnd.nextInt(choies.length)].toString() + str.substring(mat.start();
        mat = ma.matcher(str);
    return str;

Thank you in advance!