public Set<Integer> getAmbiguousTargets() {
        final Set<Integer> ambiguousTargets =
                CollectionUtil.newHashSetWithExpectedSize(numberOfTargets);
        final BitSet usedTargets = new BitSet(numberOfTargets);

        for (int[] targets : mappings) {
            for (int target : targets) {
                if (usedTargets.get(target)) {
                    ambiguousTargets.add(target);
                } else {
                    usedTargets.set(target);
                }
            }
        }

        return ambiguousTargets;
    }
@Test
    void testAmbiguousTargets() {
        RescaleMappings mapping = mappings(to(0), to(1, 2), to(), to(2, 3, 4), to(4, 5), to());

        assertThat(mapping.getAmbiguousTargets()).containsExactly(2, 4);
    }