code: public static String hidePassword(@Sensitive String s) {
          if ((s.indexOf("password") == -1) && (s.indexOf("PASSWORD") == -1)) {
              return s;
          } else {
              String ss = "";
              int indexLowerCase = s.indexOf("password");
              int indexUpperCase = s.indexOf("PASSWORD");
  
              if (indexLowerCase != -1) {
                  ss = s.substring(0, indexLowerCase + 9);
                  for (int index = (indexLowerCase + 10); index < s.length(); index++) {
                      ss = ss.concat("*");
                  }
              } else if (indexUpperCase != -1) {
                  ss = s.substring(0, indexUpperCase + 9);
                  for (int index = (indexUpperCase + 10); index < s.length(); index++) {
                      ss = ss.concat("*");
                  }
  
              }
              return ss;
          }
      }
docs: Hide the password
  
  @param string
  @return string with any passwords obfuscated