code: private static void getPunctualGeometry(ArrayList<Point> points, Geometry geometry) {
           for (int i = 0; i < geometry.getNumGeometries(); i++) {
              Geometry subGeom = geometry.getGeometryN(i);
              if(subGeom instanceof Point){
                  points.add((Point) subGeom);
              }
              else if (subGeom instanceof GeometryCollection){
                  getPunctualGeometry(points, subGeom);
              }
          }
      }
docs: Filter point from a geometry
  @param points
  @param geometry