private static boolean isValid(Geometry geom) {
    if (geom instanceof Polygon polygon) {
      return polygon.isSimple();
    } else if (geom instanceof GeometryCollection geometryCollection) {
      for (int i = 0; i < geometryCollection.getNumGeometries(); i++) {
        if (!isValid(geom.getGeometryN(i))) {
          return false;
        }
      }
    }
    return true;
  }
Returns a verification result of a basic set of checks on an mbtiles file:
<ul>
<li>has a metadata and tiles table</li>
<li>has a name metadata attribute</li>
<li>has at least one tile</li>
<li>all vector tile geometries are valid</li>
</ul>
planetiler-core/src/main/java/com/onthegomap/planetiler/mbtiles/Verify.java