class KubernetesDeploymentTargetBuildItem extends MultiBuildItem implements Comparable<KubernetesDeploymentTargetBuildItem> {

    public static List<KubernetesDeploymentTargetBuildItem> mergeList(List<KubernetesDeploymentTargetBuildItem> input) {
        List<KubernetesDeploymentTargetBuildItem> result = new ArrayList<>(input.size());
        Set<Map.Entry<String, String>> alreadyProcessedNameKindPairs = new HashSet<>();
        for (KubernetesDeploymentTargetBuildItem candidate : input) {
            Map.Entry<String, String> nameToKindEntry = candidate.nameToKindEntry();
            if (alreadyProcessedNameKindPairs.contains(nameToKindEntry)) {
                continue;
            }
            List<KubernetesDeploymentTargetBuildItem> nameAndKindMatchButNotEqual = input.stream()
                    .filter(i -> i.nameAndKindMatchButNotEquals(candidate)).collect(Collectors.toList());
            KubernetesDeploymentTargetBuildItem merged = candidate;
            for (KubernetesDeploymentTargetBuildItem toBeMerged : nameAndKindMatchButNotEqual) {
                merged = candidate.merge(toBeMerged);
            }
            result.add(merged);
            alreadyProcessedNameKindPairs.add(nameToKindEntry);
        }
        return result;
    }

    public  KubernetesDeploymentTargetBuildItem(String name, String kind);
    public  KubernetesDeploymentTargetBuildItem(String name, String kind, boolean enabled);
    public  KubernetesDeploymentTargetBuildItem(String name, String kind, int priority, boolean enabled);

}