void (boolean includeInUse, Function<MavenEmbedderWrapper, ?> func) { for (var each : myPool.keySet()) { MavenEmbedderWrapper embedder = myPool.get(each); if (embedder == null) continue; // collected if (!includeInUse && myEmbeddersInUse.contains(embedder)) continue; func.fun(embedder); } }