@Test public void shouldFindValues() { final InputSelection inputSelection = new InputSelection(1); final ObjectAccess objectAccess = new ObjectAccess("test"); final EvaluationExpression pathExpression = ExpressionUtil.makePath(inputSelection, objectAccess); final EvaluationExpression expression = new ArithmeticExpression(pathExpression, ArithmeticOperator.ADDITION, ConstantExpression.MISSING); Assert.assertSame(inputSelection, expression.findFirst(InputSelection.class)); Assert.assertSame(objectAccess, expression.findFirst(ObjectAccess.class)); }
@SuppressWarnings("unchecked") public <T extends EvaluationExpression> T findFirst(final Class<T> evaluableClass) { return (T) this.findFirst(Predicates.instanceOf(evaluableClass)); }
EvaluationExpression extends AbstractSopremoType implements ISopremoType,
		Iterable<EvaluationExpression> { @SuppressWarnings("unchecked") public <T extends EvaluationExpression> T findFirst(final Class<T> evaluableClass) { return (T) this.findFirst(Predicates.instanceOf(evaluableClass)); } }
EvaluationExpression extends AbstractSopremoType implements ISopremoType,
		Iterable<EvaluationExpression> { @SuppressWarnings("unchecked") public <T extends EvaluationExpression> T findFirst(final Class<T> evaluableClass) { return (T) this.findFirst(Predicates.instanceOf(evaluableClass)); }  }
EvaluationExpression extends AbstractSopremoType implements ISopremoType,
		Iterable<EvaluationExpression> { @SuppressWarnings("unchecked") public <T extends EvaluationExpression> T findFirst(final Class<T> evaluableClass) { return (T) this.findFirst(Predicates.instanceOf(evaluableClass)); }  @Override void appendAsString(final Appendable appendable); @Override EvaluationExpression clone(); @Override boolean equals(final Object obj); abstract IJsonNode evaluate(IJsonNode node); @SuppressWarnings("unchecked") List<T> findAll(final Class<T> evaluableClass); List<EvaluationExpression> findAll(final Predicate<? super EvaluationExpression> predicate); @SuppressWarnings("unchecked") T findFirst(final Class<T> evaluableClass); EvaluationExpression findFirst(final Predicate<? super EvaluationExpression> predicate); @Override int hashCode(); @Override ChildIterator iterator(); String printAsTree(); EvaluationExpression remove(final Class<?> expressionType); EvaluationExpression remove(final EvaluationExpression expressionToRemove); EvaluationExpression remove(final Predicate<? super EvaluationExpression> predicate); EvaluationExpression replace(final EvaluationExpression toReplace, final EvaluationExpression replaceFragment); EvaluationExpression replace(final Predicate<? super EvaluationExpression> replacePredicate,
			final EvaluationExpression replaceFragment); EvaluationExpression replace(final Predicate<? super EvaluationExpression> replacePredicate,
			final Function<EvaluationExpression, EvaluationExpression> replaceFunction); EvaluationExpression simplify(); EvaluationExpression transformRecursively(final Function<EvaluationExpression, EvaluationExpression> function); }
EvaluationExpression extends AbstractSopremoType implements ISopremoType,
		Iterable<EvaluationExpression> { @SuppressWarnings("unchecked") public <T extends EvaluationExpression> T findFirst(final Class<T> evaluableClass) { return (T) this.findFirst(Predicates.instanceOf(evaluableClass)); }  @Override void appendAsString(final Appendable appendable); @Override EvaluationExpression clone(); @Override boolean equals(final Object obj); abstract IJsonNode evaluate(IJsonNode node); @SuppressWarnings("unchecked") List<T> findAll(final Class<T> evaluableClass); List<EvaluationExpression> findAll(final Predicate<? super EvaluationExpression> predicate); @SuppressWarnings("unchecked") T findFirst(final Class<T> evaluableClass); EvaluationExpression findFirst(final Predicate<? super EvaluationExpression> predicate); @Override int hashCode(); @Override ChildIterator iterator(); String printAsTree(); EvaluationExpression remove(final Class<?> expressionType); EvaluationExpression remove(final EvaluationExpression expressionToRemove); EvaluationExpression remove(final Predicate<? super EvaluationExpression> predicate); EvaluationExpression replace(final EvaluationExpression toReplace, final EvaluationExpression replaceFragment); EvaluationExpression replace(final Predicate<? super EvaluationExpression> replacePredicate,
			final EvaluationExpression replaceFragment); EvaluationExpression replace(final Predicate<? super EvaluationExpression> replacePredicate,
			final Function<EvaluationExpression, EvaluationExpression> replaceFunction); EvaluationExpression simplify(); EvaluationExpression transformRecursively(final Function<EvaluationExpression, EvaluationExpression> function); static final PathSegmentExpression VALUE; }