com.github.rmannibucau.playx.cdi.PackageCleaner Maven / Gradle / Ivy
package com.github.rmannibucau.playx.cdi;
import java.util.ArrayList;
import java.util.Collection;
class PackageCleaner {
Collection removeOverlaps(final Collection packages) {
return new ArrayList<>(packages).stream().sorted().collect(ArrayList::new, (output, pck) -> {
if (output.stream().noneMatch(it -> pck.startsWith(it + '.'))) {
output.add(pck);
}
}, Collection::addAll);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy