public static boolean isMD5String(final String string){
  Preconditions.checkNotNull(string,"Error: String argument can't be null");
  return (string.length() == 32) && isHexString(string);
}

public static boolean isMD5String ( final String string ) { Preconditions . checkNotNull ( string , "Error: String argument can't be null" ) ; return ( string . length ( ) == 32 ) && isHexString ( string ) ; }
tests whether a given string is a valid md5 string .
