BitmaskUtils { public static List<Integer> getFieldPositions(final byte[] bitmask) { return fieldPositionCache.getUnchecked(new ByteArray(bitmask)); }  static byte[] generateANDBitmask(final byte[] bitmask1, final byte[] bitmask2); static boolean isAnyBitSet(final byte[] array); static byte[] generateCompositeBitmask(final SortedSet<Integer> fieldPositions); static byte[] generateCompositeBitmask(final Integer fieldPosition); static List<Integer> getFieldPositions(final byte[] bitmask); static int getLowestFieldPosition(final byte[] bitmask); static byte[] generateFieldSubsetBitmask(
      final CommonIndexModel indexModel,
      final String[] fieldNames,
      final DataTypeAdapter<?> adapterAssociatedWithFieldIds); static byte[] constructNewValue(
      final byte[] value,
      final byte[] originalBitmask,
      final byte[] newBitmask);  }
@Test public void testGetOrdinal() { List<Integer> positions = BitmaskUtils.getFieldPositions(zeroth.toByteArray()); Assert.assertTrue(0 == positions.get(0)); Assert.assertTrue(1 == positions.size()); positions = BitmaskUtils.getFieldPositions(first.toByteArray()); Assert.assertTrue(1 == positions.get(0)); Assert.assertTrue(1 == positions.size()); positions = BitmaskUtils.getFieldPositions(eighth.toByteArray()); Assert.assertTrue(8 == positions.get(0)); Assert.assertTrue(1 == positions.size()); }
@Test public void testDecompositionOfComposite() { final List<Integer> positions = BitmaskUtils.getFieldPositions(composite_0_1_2.toByteArray()); Assert.assertTrue(positions.size() == 3); Assert.assertTrue(0 == positions.get(0)); Assert.assertTrue(1 == positions.get(1)); Assert.assertTrue(2 == positions.get(2)); }