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

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