public FilterValidator isMethod(final MethodKind methodKind, final int parameterCount) {
   assertTrue("Current expression is not a methodCall", curExpression instanceof Method);
   Method methodCall = (Method) curExpression;
   assertEquals(methodKind, methodCall.getMethod());
   assertEquals(parameterCount, methodCall.getParameters().size());
   return this;
 }
 public FilterValidator goParameter(final int parameterIndex) {
   if (curExpression instanceof Method) {
     Method methodCall = (Method) curExpression;
     curExpression = methodCall.getParameters().get(parameterIndex);
   } else {
     fail("Current expression not a methodCall");
   }
   return this;
 }
  public FilterValidator isParameterText(final int parameterIndex, final String parameterText)
      throws ExpressionVisitException, ODataApplicationException {

    if (!(curExpression instanceof Method)) {
      fail("Current expression is not a method");
    }

    Method methodCall = (Method) curExpression;

    Expression parameter = methodCall.getParameters().get(parameterIndex);
    String actualParameterText = FilterTreeToText.Serialize(parameter);
    assertEquals(parameterText, actualParameterText);
    return this;
  }
 public FilterValidator goParameter(final int parameterIndex) {
   assertTrue("Current expression not a methodCall", curExpression instanceof Method);
   Method methodCall = (Method) curExpression;
   curExpression = methodCall.getParameters().get(parameterIndex);
   return this;
 }