LongBitMask extends SingleLongBitMask implements BitMask { @Override public BitMask setAll(BitMask mask) { if (mask instanceof LongBitMask) { this.mask |= ((LongBitMask) mask).asLong(); } else if (mask instanceof AllSetBitMask) { return AllSetBitMask.get(); } else if (mask instanceof AllSetButLastBitMask) { return isSet(0) ? AllSetBitMask.get() : AllSetButLastBitMask.get(); } else if (mask instanceof OpenBitSet) { return mask.setAll(this); } else if (mask instanceof EmptyButLastBitMask) { return set(0); } return this; } LongBitMask();  LongBitMask(long mask); @Override BitMask set(int index); @Override BitMask setAll(BitMask mask); @Override BitMask reset(int index); @Override BitMask resetAll(BitMask mask); @Override boolean isSet(int index); @Override boolean isAllSet(); @Override boolean isEmpty(); @Override boolean intersects(BitMask mask); long asLong(); @Override LongBitMask clone(); @Override String getInstancingStatement();  }
@Test public void testSetAll() { Assert.assertEquals("0", new LongBitMask().setAll(new LongBitMask()).toString()); Assert.assertEquals("-1", new LongBitMask().setAll(AllSetBitMask.get()).toString()); Assert.assertEquals("9223372036854775807", new LongBitMask().setAll(AllSetButLastBitMask.get()).toString()); Assert.assertEquals("-1", new LongBitMask(1).setAll(AllSetButLastBitMask.get()).toString()); Assert.assertEquals("0", new LongBitMask().setAll(new OpenBitSet()).toString()); Assert.assertEquals("1", new LongBitMask().setAll(EmptyButLastBitMask.get()).toString()); Assert.assertEquals("0", new LongBitMask().setAll(EmptyBitMask.get()).toString()); }