}
@Test
public void testWith2ShardProjections() throws Exception {
TopNProjection topN = new TopNProjection(0, 1);
GroupProjection groupProjection1 = new GroupProjection(
Arrays.<DataTypeSymbol>asList(Literal.newLiteral(true)),
Arrays.asList(countAggregation()));
groupProjection1.setRequiredGranularity(RowGranularity.SHARD);
GroupProjection groupProjection2 = new GroupProjection(
Arrays.<DataTypeSymbol>asList(Literal.newLiteral(true)),
Arrays.asList(countAggregation()));
groupProjection2.setRequiredGranularity(RowGranularity.SHARD);
ShardProjectorChain chain = new ShardProjectorChain(2, ImmutableList.of(groupProjection1, groupProjection2, topN), projectionToProjectorVisitor);
assertThat(chain.nodeProjectors.size(), is(2));
assertThat(chain.nodeProjectors.get(0), is(instanceOf(GroupingProjector.class)));
assertThat(chain.nodeProjectors.get(1), is(instanceOf(SimpleTopNProjector.class)));