### Question:
CuboidScheduler { public Collection<Long> findSmallerSibling(long cuboid) { if (!Cuboid.isValid(cubeDef, cuboid)) { return Collections.emptyList(); } RowKeyDesc rowkey = cubeDef.getRowkey(); long groupAllBitMask = 0; for (AggrGroupMask mask : rowkey.getAggrGroupMasks()) { if ((mask.groupMask & cuboid) > 0) { groupAllBitMask |= mask.groupMask; } } long groupBitValue = cuboid & groupAllBitMask; long leftBitValue = cuboid & ~groupAllBitMask; long[] groupOneBits = bits(groupAllBitMask); Collection<Long> siblings = new HashSet<Long>(); combination(cuboid, siblings, groupOneBits, 0, leftBitValue, Long.bitCount(groupBitValue)); return siblings; } CuboidScheduler(CubeDesc cube); Collection<Long> getSpanningCuboid(long cuboid); Collection<Long> findSmallerSibling(long cuboid); int getCardinality(long cuboid);  }### Answer:
@Test public void testFindSmallerSibling1() { CubeDesc cube = getTestKylinCubeWithoutSeller(); CuboidScheduler scheduler = new CuboidScheduler(cube); Collection<Long> siblings; siblings = scheduler.findSmallerSibling(255); assertEquals("[]", siblings.toString()); siblings = scheduler.findSmallerSibling(133); assertEquals("[131]", siblings.toString()); siblings = scheduler.findSmallerSibling(127); assertEquals("[]", siblings.toString()); siblings = scheduler.findSmallerSibling(134); assertEquals("[131, 133]", sortToString(siblings)); siblings = scheduler.findSmallerSibling(130); assertEquals("[129]", siblings.toString()); siblings = scheduler.findSmallerSibling(5); assertEquals("[]", siblings.toString()); siblings = scheduler.findSmallerSibling(135); assertEquals("[]", siblings.toString()); }
@Test public void testFindSmallerSibling2() { CubeDesc cube = getTestKylinCubeWithSeller(); CuboidScheduler scheduler = new CuboidScheduler(cube); Collection<Long> siblings; siblings = scheduler.findSmallerSibling(511); assertEquals("[]", siblings.toString()); siblings = scheduler.findSmallerSibling(toLong("110111111")); assertEquals("[383]", siblings.toString()); siblings = scheduler.findSmallerSibling(toLong("101110111")); assertEquals("[319]", siblings.toString()); siblings = scheduler.findSmallerSibling(toLong("111111000")); assertEquals("[]", siblings.toString()); siblings = scheduler.findSmallerSibling(toLong("111111000")); assertEquals("[]", siblings.toString()); siblings = scheduler.findSmallerSibling(toLong("110000000")); assertEquals("[288, 320]", sortToString(siblings)); }