cdkbook

BitSetDemo.groovy

Source code:

@Grab(group='org.openscience.cdk', module='cdk-bundle', version='2.9')

import java.util.BitSet;
bitset = new BitSet(10);
println "Empty bit set: $bitset";
bitset.set(3);
bitset.set(7);
println "Two bits set: $bitset";

Output:

Empty bit set: {}
Two bits set: {3, 7}