@Test
public void calculateCenterPoints() {

    ArrayList<Feature> featuresList = new ArrayList<>();
    ArrayList<Point> pointsListLower1 = new ArrayList<>();
    pointsListLower1.add(Point.fromLngLat(5d, 8d));
    pointsListLower1.add(Point.fromLngLat(8d, 8d));
    pointsListLower1.add(Point.fromLngLat(8d, 5d));
    pointsListLower1.add(Point.fromLngLat(5d, 5d));
    ArrayList<List<Point>> pointsListUpper1 = new ArrayList<>();
    pointsListUpper1.add(pointsListLower1);
    featuresList.add(Feature.fromGeometry(Polygon.fromLngLats(pointsListUpper1)));
    featuresList.add(Feature.fromGeometry(Point.fromLngLat(9.1d, 9.1d)));
    featuresList.add(Feature.fromGeometry(Point.fromLngLat(11.1d, 9.1d)));
    featuresList.add(Feature.fromGeometry(Point.fromLngLat(11.1d, 2.1d)));
    featuresList.add(Feature.fromGeometry(Point.fromLngLat(9.1d, 2.1d)));
    FeatureCollection featureCollection = FeatureCollection.fromFeatures(featuresList);
    BoundaryLayer.Builder builder = new BoundaryLayer.Builder(featureCollection)
            .setLabelProperty("name")
            .setLabelTextSize(20f)
            .setLabelColorInt(Color.RED)
            .setBoundaryColor(Color.RED)
            .setBoundaryWidth(6f);
    BoundaryLayer boundaryLayer = builder.build();
    FeatureCollection centerPointsFeatureCollection = ReflectionHelpers.callInstanceMethod(boundaryLayer
            , "calculateCenterPoints"
            , ReflectionHelpers.ClassParameter.from(FeatureCollection.class, featureCollection)
    );
    List<Feature> centerPointFeatures = centerPointsFeatureCollection.features();
    assertEquals(5, centerPointFeatures.size());
    Point point1 = (Point) centerPointFeatures.get(0).geometry();
    Point point2 = (Point) centerPointFeatures.get(1).geometry();
    assertPointEquals(Point.fromLngLat(6.5d, 6.5d), point1);
    assertPointEquals(Point.fromLngLat(9.1d, 9.1d), point2);
}