public static UUID convertUUID(String input) throws IllegalArgumentException {
  try {
    return UUID.fromString(input);
  }
 catch (  IllegalArgumentException ex) {
    return UUID.fromString(input.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})","$1-$2-$3-$4-$5"));
  }
}

public static UUID convertUUID ( String input ) throws IllegalArgumentException { try { return UUID . fromString ( input ) ; } catch ( IllegalArgumentException ex ) { return UUID . fromString ( input . replaceAll ( "(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})" , "$1-$2-$3-$4-$5" ) ) ; } }
convert a string to a uuid < p / > this method will add the required dashes , if not found in string
