- Collection<StatementContextBase<?, ?, ?>> substatementsToBuild = Collections2.filter(substatementsInit,
- IS_SUPPORTED_TO_BUILD_EFFECTIVE);
- if (!buildUnknownSubstatements) {
- this.unknownSubstatementsToBuild = ImmutableList.copyOf(Collections2.filter(substatementsToBuild,
- IS_UNKNOWN_STATEMENT_CONTEXT));
- substatementsToBuild = Collections2.filter(substatementsToBuild,
- Predicates.not(IS_UNKNOWN_STATEMENT_CONTEXT));
- } else {
- this.unknownSubstatementsToBuild = ImmutableList.of();
- }
-
- final Function<StmtContext<?, ?, ? extends EffectiveStatement<?, ?>>, EffectiveStatement<?, ?>> buildEffective = StmtContextUtils
- .buildEffective();
- this.substatements = ImmutableList.copyOf(Collections2.transform(substatementsToBuild, buildEffective));
- }
-
- Collection<EffectiveStatement<?, ?>> getOmittedUnknownSubstatements() {
- final Function<StmtContext<?, ?, ? extends EffectiveStatement<?, ?>>, EffectiveStatement<?, ?>> buildEffective = StmtContextUtils
- .buildEffective();
- return Collections2.transform(unknownSubstatementsToBuild, buildEffective);
+ this.substatements = ImmutableList.copyOf(Collections2.transform(Collections2.filter(substatementsInit,
+ StmtContext::isSupportedToBuildEffective), StatementContextBase::buildEffective));