src/core/se/jbee/inject/bootstrap/Binding.java
public static Binding<?>[] disambiguate(Binding<?>[] bindings) {
		if (bindings.length <= 1) {
			return bindings;
		}
		List<Binding<?>> uniques = new ArrayList<>(bindings.length);
		Arrays.sort(bindings);
		uniques.add(bindings[0]);
		int lastUniqueIndex = 0;
		Set<Type<?>> required = new HashSet<>();
		List<Binding<?>> dropped = new ArrayList<>();
		for (int i = 1; i < bindings.length; i++) {
			Binding<?> b_d = bindings[lastUniqueIndex];
			Binding<?> b_i = bindings[i];
			final boolean equalResource = b_d.resource.equalTo(b_i.resource);
			DeclarationType t_d = b_d.source.declarationType;
			DeclarationType t_i = b_i.source.declarationType;
			if (equalResource && t_d.clashesWith(t_i)) {
				throw new InconsistentBinding(
						"Duplicate binds:\n" + b_d + "\n" + b_i);
			}
			if (t_i == DeclarationType.REQUIRED) {
				required.add(b_i.resource.type());
			} else if (equalResource && t_d.droppedWith(t_i)) {
				if (i - 1 == lastUniqueIndex) {
					dropped.add(uniques.remove(uniques.size() - 1));
				}
				dropped.add(b_i);
			} else if (!equalResource || !t_i.replacedBy(t_d)) {
				uniques.add(b_i);
				lastUniqueIndex = i;
			}
		}
		return withoutProvidedThatAreNotRequiredIn(uniques, required, dropped);
	}
public static Binding<?>[] disambiguate(Binding<?>[] bindings) {
		if (bindings.length <= 1) {
			return bindings;
		}
		List<Binding<?>> uniques = new ArrayList<>(bindings.length);
		Arrays.sort(bindings);
		uniques.add(bindings[0]);
		int lastUniqueIndex = 0;
		Set<Type<?>> required = new HashSet<>();
		List<Binding<?>> dropped = new ArrayList<>();
		for (int i = 1; i < bindings.length; i++) {
			Binding<?> b_d = bindings[lastUniqueIndex];
			Binding<?> b_i = bindings[i];
			final boolean equalResource = b_d.resource.equalTo(b_i.resource);
			DeclarationType t_d = b_d.source.declarationType;
			DeclarationType t_i = b_i.source.declarationType;
			if (equalResource && t_d.clashesWith(t_i)) {
				throw new InconsistentBinding(
						"Duplicate binds:\n" + b_d + "\n" + b_i);
			}
			if (t_i == DeclarationType.REQUIRED) {
				required.add(b_i.resource.type());
			} else if (equalResource && t_d.droppedWith(t_i)) {
				if (i - 1 == lastUniqueIndex) {
					dropped.add(uniques.remove(uniques.size() - 1));
				}
				dropped.add(b_i);
			} else if (!equalResource || !t_i.replacedBy(t_d)) {
				uniques.add(b_i);
				lastUniqueIndex = i;
			}
		}
		return withoutProvidedThatAreNotRequiredIn(uniques, required, dropped);
	}
Removes those bindings that are ambiguous but also do not clash because
of different {@link DeclarationType}s that replace each other.