PathExpression extends ContainerExpression implements Cloneable { public EvaluationExpression getFragment(final int index) { return this.fragments.get(index); } PathExpression(final EvaluationExpression... fragments);  PathExpression(final List<? extends EvaluationExpression> fragments); private  PathExpression(final LinkedList<EvaluationExpression> fragments); void add(final EvaluationExpression fragment); @Override PathExpression clone(); @Override boolean equals(final Object obj); @Override IJsonNode evaluate(final IJsonNode node, final IJsonNode target, final EvaluationContext context); int getDepth(); EvaluationExpression getFragment(final int index); EvaluationExpression getLastFragment(); List<EvaluationExpression> getFragments(); @Override int hashCode(); boolean isPrefix(final PathExpression prefix); @Override List<EvaluationExpression> getChildren(); @Override void setChildren(final List<? extends EvaluationExpression> children); @Override void toString(final StringBuilder builder); static PathExpression ensurePathExpression(final EvaluationExpression expression); static EvaluationExpression wrapIfNecessary(final List<EvaluationExpression> expressions); static EvaluationExpression wrapIfNecessary(final EvaluationExpression... expressions); @Override IJsonNode set(final IJsonNode node, final IJsonNode value, final EvaluationContext context); void removeLast(); void add(final int index, final EvaluationExpression fragment); PathExpression subPath(int start, int end);  }
@Test public void shouldFindRightFragment() { final EvaluationExpression result = new PathExpression(new ObjectAccess("glossary"), new ObjectAccess("GlossDiv"), new ObjectAccess("GlossList")).getFragment(1); Assert.assertEquals(new ObjectAccess("GlossDiv"), result); }