[java] Generating all permutations of a given string