private void fillVector(OrdinalValue<?>[] elements) {
      for (OrdinalValue<?> e : elements) {
        int ordinal = e.ordinal();
        int wordIndex = ordinal >>> POWER_OF_TWO_WORD_BITS;
        int bitIndex = ordinal - (wordIndex << POWER_OF_TWO_WORD_BITS);
        long word = vector[wordIndex];
        if (((word >>> bitIndex) & 1) != 0) {
          checkArgument(false, "Duplicate element %s", e);
        }
        vector[wordIndex] = word | (1L << bitIndex);
      }
    }
Will throw an exception and leave the collection unmodified.
@throws UnsupportedOperationException always
@deprecated Modification operation are not supported.
ordinal/src/org/immutables/ordinal/ImmutableOrdinalSet.java