LongBitMask extends SingleLongBitMask implements BitMask { @Override public BitMask resetAll(BitMask mask) { if (mask instanceof LongBitMask) { this.mask &= (-1L - ((LongBitMask) mask).asLong()); return this; } else if (mask instanceof AllSetBitMask) { return EmptyBitMask.get(); } else if (mask instanceof AllSetButLastBitMask) { this.mask &= Long.MIN_VALUE; return this; } else if (mask instanceof EmptyButLastBitMask) { return reset(0); } else if (mask instanceof EmptyBitMask) { return this; } throw new RuntimeException("Cannot resetAll a LongBitMask with a " + mask.getClass().getSimpleName()); } 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 testResetAll() { Assert.assertEquals("0", new LongBitMask().resetAll(new LongBitMask()).toString()); Assert.assertEquals("0", new LongBitMask().resetAll(AllSetBitMask.get()).toString()); Assert.assertEquals("0", new LongBitMask().resetAll(AllSetButLastBitMask.get()).toString()); Assert.assertEquals("0", new LongBitMask().resetAll(EmptyButLastBitMask.get()).toString()); Assert.assertEquals("0", new LongBitMask().resetAll(EmptyBitMask.get()).toString()); thrown.expect(RuntimeException.class); new LongBitMask().resetAll(new OpenBitSet()).toString(); }