bitmap4 implements XdrAble, Iterable<Integer> { public boolean isSet(int bit) { int bitmapIdx = bit / Integer.SIZE; if (value == null || bitmapIdx + 1 > value.length) { return false; } return ((value[bitmapIdx] >> bit % Integer.SIZE) & 1) > 0; } bitmap4();  bitmap4(int [] value);  bitmap4(XdrDecodingStream xdr); void xdrEncode(XdrEncodingStream xdr); void xdrDecode(XdrDecodingStream xdr); static bitmap4 of(int ... values); void set(int bit); boolean isSet(int bit); boolean isEmpty(); @Override Iterator<Integer> iterator(); @Override int hashCode(); @Override boolean equals(Object obj); public int[] value; }
@Test public void testIsSetNoValues() { bitmap4 bitmap = new bitmap4(); assertFalse(bitmap.isSet(5)); }