class ClouderaManagerParcelService {

    public void deactivateUnusedParcels(ParcelsResourceApi parcelsResourceApi, ParcelResourceApi parcelResourceApi, String stackName, Map<String,
            ClouderaManagerProduct> cmProducts) {
        Map<String, String> installedComponents = getParcelsInStatus(parcelsResourceApi, stackName, ParcelStatus.ACTIVATED);
        Map<String, String> filteredParcels = installedComponents.entrySet().stream()
                .filter(entry -> !cmProducts.containsKey(entry.getKey()))
                .collect(toMap(Map.Entry::getKey, Map.Entry::getValue));
        deactivateParcels(parcelResourceApi, stackName, filteredParcels);
    }

}