HilbertIndexMasks { public void copyMaskTo(int i, int d, BitVector mu) { mu.copyFrom(masks[i]); mu.rotate(d); } HilbertIndexMasks(MultiDimensionalSpec spec); int getCardinality(int i); List<Integer> cardinalities(); void copyMaskTo(int i, int d, BitVector mu);  }
@Test public void extractMaskOneDimensionOneBit() { HilbertIndexMasks masks = new HilbertIndexMasks(new MultiDimensionalSpec(Arrays.asList(1))); BitVector mu = BitVectorFactories.OPTIMAL.apply(1); masks.copyMaskTo(0, 0, mu); BitVector expected = TestUtils.createBitVector(1, 1); Assert.assertEquals(expected, mu); }
@Test public void extractMaskTwoDimensions() { HilbertIndexMasks masks = new HilbertIndexMasks(new MultiDimensionalSpec(Arrays.asList(5, 4))); BitVector mu = BitVectorFactories.OPTIMAL.apply(2); masks.copyMaskTo(3, 0, mu); BitVector expected = TestUtils.createBitVector(3, 2); Assert.assertEquals(expected, mu); }