java for string permutation question