private static GeoItem listToItem(final List<GeoPrimitive> items) {
        if (items == null) {
            return GeoGroup.create();
        }
        //Sole invalid items should not make whole GeoJson unrenderable. Thus remove invalid items. See e.g. #15074
        CommonUtils.filterCollection(items, item -> item != null && item.isValid());

        if (items.size() == 1) {
            return items.get(0);
        }
        return GeoGroup.create(items);
    }
Utility class to work with GeoJson
main/src/main/java/cgeo/geocaching/utils/GeoJsonUtils.java