AltcoinBlock extends org.bitcoinj.core.Block { public BitSet getVersionFlags() { final BitSet bitset = new BitSet(BYTE_BITS); final int bits = (int) (this.getRawVersion() & 0xff00) >> 8; for (int bit = 0; bit < BYTE_BITS; bit++) { if ((bits & (1 << bit)) > 0) { bitset.set(bit); } } return bitset; } AltcoinBlock(final NetworkParameters params, final long version);  AltcoinBlock(final NetworkParameters params, final byte[] payloadBytes);  AltcoinBlock(final NetworkParameters params, final byte[] payloadBytes,
            final int offset, final MessageSerializer serializer, final int length);  AltcoinBlock(NetworkParameters params, byte[] payloadBytes, int offset,
        Message parent, MessageSerializer serializer, int length);  AltcoinBlock(NetworkParameters params, long version, Sha256Hash prevBlockHash, Sha256Hash merkleRoot, long time,
                 long difficultyTarget, long nonce, List<Transaction> transactions); AuxPoW getAuxPoW(); void setAuxPoW(AuxPoW auxpow); ScryptHash getScryptHash(); String getScryptHashAsString(); @Override Coin getBlockInflation(int height); static long getChainID(final long rawVersion); long getChainID(); BitSet getVersionFlags(); final long getRawVersion(); static long getBaseVersion(final long rawVersion); @Override long getVersion(); @Override Block cloneAsHeader(); @Override void verifyHeader();  }
@Test public void testGetVersionFlags() { AltcoinBlock block = new AltcoinBlock(params, 0L); BitSet expected = new BitSet(8); assertEquals(block.getVersionFlags(), expected); block = new AltcoinBlock(params, 0xffff00ff); assertEquals(block.getVersionFlags(), expected); block = new AltcoinBlock(params, 0xffffffff); expected.set(0, 8); assertEquals(block.getVersionFlags(), expected); block = new AltcoinBlock(params, 0x0000ff00); assertEquals(block.getVersionFlags(), expected); block = new AltcoinBlock(params, 0x00001700); expected.clear(0, 8); expected.set(0, 3); expected.set(4); assertEquals(block.getVersionFlags(), expected); }