code: @Deprecated
      public static void permute(String source, boolean skipZeros, Set<String> output) {
          // TODO: optimize
          //if (PROGRESS) System.out.println("Permute: " + source);
  
          // optimization:
          // if zero or one character, just return a set with it
          // we check for length < 2 to keep from counting code points all the time
          if (source.length() <= 2 && UTF16.countCodePoint(source) <= 1) {
              output.add(source);
              return;
          }
  
          // otherwise iterate through the string, and recursively permute all the other characters
          Set<String> subpermute = new HashSet<String>();
          int cp;
          for (int i = 0; i < source.length(); i += UTF16.getCharCount(cp)) {
              cp = UTF16.charAt(source, i);
  
              // optimization:
              // if the character is canonical combining class zero,
              // don't permute it
              if (skipZeros && i != 0 && UCharacter.getCombiningClass(cp) == 0) {
                  //System.out.println("Skipping " + Utility.hex(UTF16.valueOf(source, i)));
                  continue;
              }
  
              // see what the permutations of the characters before and after this one are
              subpermute.clear();
              permute(source.substring(0,i)
                  + source.substring(i + UTF16.getCharCount(cp)), skipZeros, subpermute);
  
              // prefix this character to all of them
              String chStr = UTF16.valueOf(source, i);
              for (String s : subpermute) {
                  String piece = chStr + s;
                  //if (PROGRESS) System.out.println("  Piece: " + piece);
                  output.add(piece);
              }
          }
      }
docs: Simple implementation of permutation.
  <br><b>Warning: The strings are not guaranteed to be in any particular order.</b>
  @param source the string to find permutations for
  @param skipZeros set to true to skip characters with canonical combining class zero
  @param output the set to add the results to
  @deprecated This API is ICU internal only.
  @hide draft / provisional / internal are hidden on Android