ProjectionsContext { public boolean isUnqualifiedShorthandProjection() { if (1 != projections.size()) { return false; } Projection projection = projections.iterator().next(); return projection instanceof ShorthandProjection && !((ShorthandProjection) projection).getOwner().isPresent(); }  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 assertUnqualifiedShorthandProjectionWithEmptyItems() { ProjectionsContext projectionsContext = new ProjectionsContext(0, 0, true, Collections.emptySet()); assertFalse(projectionsContext.isUnqualifiedShorthandProjection()); }
@Test public void assertUnqualifiedShorthandProjectionWithWrongProjection() { ProjectionsContext projectionsContext = new ProjectionsContext(0, 0, true, Collections.singleton(getColumnProjection())); assertFalse(projectionsContext.isUnqualifiedShorthandProjection()); }
@Test public void assertUnqualifiedShorthandProjectionWithWrongShortProjection() { ProjectionsContext projectionsContext = new ProjectionsContext(0, 0, true, Collections.singleton(getShorthandProjection())); assertFalse(projectionsContext.isUnqualifiedShorthandProjection()); }
@Test public void assertUnqualifiedShorthandProjection() { Projection projection = new ShorthandProjection(null, Collections.emptyList()); ProjectionsContext projectionsContext = new ProjectionsContext(0, 0, true, Collections.singleton(projection)); assertTrue(projectionsContext.isUnqualifiedShorthandProjection()); }