code: public static String isValidReason(Geometry geometry, int flag) {
          if (geometry != null) {
              if (flag == 0) {
                  return validReason(geometry, false);
              } else if (flag == 1) {
                  return validReason(geometry, true);
              } else {
                  throw new IllegalArgumentException("Supported arguments are 0 or 1.");
              }
          }
          return "Null Geometry";
      }
docs: Returns text stating whether a geometry is valid.
  If not, returns a reason why.
  
  @param geometry
  @param flag
  @return