code: private static PasswordCredential createCredentialFromPassword(char[] password) throws UnsupportedCredentialTypeException {
          try {
              PasswordFactory passwordFactory = PasswordFactory.getInstance(ClearPassword.ALGORITHM_CLEAR);
              return new PasswordCredential(passwordFactory.generatePassword(new ClearPasswordSpec(password)));
          } catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
              throw new UnsupportedCredentialTypeException(e);
          }
      }
docs: Convert {@code char[]} password to {@code PasswordCredential}
  @param password to convert
  @return new {@code PasswordCredential}
  @throws UnsupportedCredentialTypeException should never happen as we have only supported types and algorithms