ProjectionsContext { public Optional<String> findAlias(final String projectionName) { for (Projection each : projections) { if (projectionName.equalsIgnoreCase(each.getExpression())) { return each.getAlias(); } } return Optional.empty(); }  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 assertFindAliasWithOutAlias() { ProjectionsContext projectionsContext = new ProjectionsContext(0, 0, true, Collections.emptyList()); assertFalse(projectionsContext.findAlias("").isPresent()); }
@Test public void assertFindAlias() { Projection projection = getColumnProjectionWithAlias(); ProjectionsContext projectionsContext = new ProjectionsContext(0, 0, true, Collections.singleton(projection)); assertTrue(projectionsContext.findAlias(projection.getExpression()).isPresent()); }