ImmutablePipeline implements Pipeline { @Override public void validate() { stageExpressions.stream() .map(expression -> expression.replaceFirst( functionExpression.getPrefix() + FunctionExpression.SEPARATOR, "")) .forEach(expression -> { if (!functionExpression.supports(expression)) { throw PlaceholderFunctionUnknownException.newBuilder(expression).build(); } }); } ImmutablePipeline(final FunctionExpression functionExpression, final List<String> stageExpressions); @Override PipelineElement execute(final PipelineElement pipelineInput, final ExpressionResolver expressionResolver); @Override void validate(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test(expected = PlaceholderFunctionUnknownException.class) public void validate() { prepareFunctionExpressionResponses(); final ImmutablePipeline pipeline = new ImmutablePipeline(functionExpression, INVALID_STAGES); pipeline.validate(); }