code: public static boolean validate(@Nullable String id) {
      if (id == null) {
        return false;
      }
      Matcher matcher = PROJECT_ID_REGEX.matcher(id);
      return matcher.matches();
    }
docs: Check whether a string is a syntactically correct project ID. This method only checks syntax.
  It does not check that the ID actually identifies a project in the Google Cloud Platform.
  
  @param id the alleged project ID
  @return true if it's correct, false otherwise