@SuppressWarnings("unchecked")
    private <T extends Layer> T getZLevelLayer(final int zLevel, final java.util.Map<Integer, T> layerMap, final Class<T> layerClass, final Supplier<T> layerCreator) {
        layerMapLock.lock();
        try {
            T zLayer = layerMap.get(zLevel);
            if (zLayer != null || layerCreator == null) {
                return zLayer;
            }

            //search for an existing layer, create if not existing
            synchronized (mapLayers) {
                final int layerIdx = mapLayers.groupIndexOf(zLevel, c -> layerClass.isAssignableFrom(c.getClass()));
                if (layerIdx > 0) {
                    zLayer = (T) mapLayers.get(layerIdx);
                } else {
                    //create marker layer first, then vectorlayer. That way, markers will always be shown above shapes with same zLevel
                    zLayer = layerCreator.get();
                    mapLayers.addToGroup(zLayer, zLevel);
                }
            }

            layerMap.put(zLevel, zLayer);

            return zLayer;

        } finally {
            layerMapLock.unlock();
        }
    }
mimics {@link #removeItem(MarkerInterface)} but w/o calling 'populate'
main/src/main/java/cgeo/geocaching/unifiedmap/geoitemlayer/MapsforgeVtmGeoItemLayer.java