code: public static boolean isValidMapcodeFormat(@Nonnull final String mapcode) throws IllegalArgumentException {
          checkNonnull("mapcode", mapcode);
          try {
              // Throws an exception if the format is incorrect.
              getPrecisionFormat(mapcode.toUpperCase());
              return true;
          } catch (final UnknownPrecisionFormatException ignored) {
              return false;
          }
      }
docs: This method provides a shortcut to checking if a mapcode string is formatted properly or not at all.
  
  @param mapcode Mapcode (optionally with a territory).
  @return True if the mapcode format, the syntax, is correct. This does not mean the mapcode code is
  actually a valid  mapcode representing a location on Earth.
  @throws IllegalArgumentException If mapcode is null.