{
CompositeType comparator = CompositeType.getInstance(Int32Type.instance, Int32Type.instance, Int32Type.instance);
// all slices intersect
SliceQueryFilter filter = new SliceQueryFilter(new ColumnSlice[]{
new ColumnSlice(composite(1, 0, 0), composite(2, 0, 0)),
new ColumnSlice(composite(3, 0, 0), composite(4, 0, 0)),
new ColumnSlice(composite(5, 0, 0), composite(6, 0, 0)),
}, false, 1);
// first slice doesn't intersect
assertTrue(comparator.intersects(columnNames(0, 0, 0), columnNames(7, 0, 0), filter));
filter = new SliceQueryFilter(new ColumnSlice[]{
new ColumnSlice(composite(1, 0, 0), composite(2, 0, 0)),
new ColumnSlice(composite(3, 0, 0), composite(4, 0, 0)),
new ColumnSlice(composite(5, 0, 0), composite(6, 0, 0)),
}, false, 1);
assertTrue(comparator.intersects(columnNames(3, 0, 0), columnNames(7, 0, 0), filter));
// first two slices don't intersect
assertTrue(comparator.intersects(columnNames(0, 0, 0), columnNames(7, 0, 0), filter));
filter = new SliceQueryFilter(new ColumnSlice[]{
new ColumnSlice(composite(1, 0, 0), composite(2, 0, 0)),
new ColumnSlice(composite(3, 0, 0), composite(4, 0, 0)),
new ColumnSlice(composite(5, 0, 0), composite(6, 0, 0)),
}, false, 1);
assertTrue(comparator.intersects(columnNames(5, 0, 0), columnNames(7, 0, 0), filter));
// none of the slices intersect
assertTrue(comparator.intersects(columnNames(0, 0, 0), columnNames(7, 0, 0), filter));
filter = new SliceQueryFilter(new ColumnSlice[]{
new ColumnSlice(composite(1, 0, 0), composite(2, 0, 0)),
new ColumnSlice(composite(3, 0, 0), composite(4, 0, 0)),
new ColumnSlice(composite(5, 0, 0), composite(6, 0, 0)),
}, false, 1);
assertFalse(comparator.intersects(columnNames(7, 0, 0), columnNames(8, 0, 0), filter));
}