return clone(array);
}
final HashMap<Boolean, MutableInt> occurrences = new HashMap<Boolean, MutableInt>(2); // only two possible values here
for (final boolean v : values) {
final Boolean boxed = Boolean.valueOf(v);
final MutableInt count = occurrences.get(boxed);
if (count == null) {
occurrences.put(boxed, new MutableInt(1));
} else {
count.increment();
}
}
final BitSet toRemove = new BitSet();
for (final Map.Entry<Boolean, MutableInt> e : occurrences.entrySet()) {
final Boolean v = e.getKey();