ProjectionsContext { public List<Projection> getExpandProjections() { List<Projection> result = new ArrayList<>(); for (Projection each : projections) { if (each instanceof ShorthandProjection) { result.addAll(((ShorthandProjection) each).getActualColumns()); } else if (!(each instanceof DerivedProjection)) { result.add(each); } } return result; }  boolean isUnqualifiedShorthandProjection(); Optional<String> findAlias(final String projectionName); Optional<Integer> findProjectionIndex(final String projectionName); List<AggregationProjection> getAggregationProjections(); List<AggregationDistinctProjection> getAggregationDistinctProjections(); List<Projection> getExpandProjections();  }
@Test public void assertGetExpandProjections() { ColumnProjection columnProjection1 = new ColumnProjection(null, "col1", null); ColumnProjection columnProjection2 = new ColumnProjection(null, "col2", null); ColumnProjection columnProjection3 = new ColumnProjection(null, "col3", null); DerivedProjection derivedProjection = new DerivedProjection("col3", "a3", null); ShorthandProjection shorthandProjection = new ShorthandProjection(null, Arrays.asList(columnProjection2, columnProjection3)); ProjectionsContext actual = new ProjectionsContext(0, 0, false, Arrays.asList(columnProjection1, shorthandProjection, derivedProjection)); assertThat(actual.getExpandProjections().size(), is(3)); assertThat(actual.getExpandProjections().get(0), is(columnProjection1)); assertThat(actual.getExpandProjections().get(1), is(columnProjection2)); assertThat(actual.getExpandProjections().get(2), is(columnProjection3)); }