MethodCallExpr extends ExprBase<ExprExecCtxt> implements OptionalExpression { public static MethodCallExpr parse(ParseCtxt ctxt) { int startPos = ctxt.getPos(); NameWithModifier n = NameWithModifier.parseNameAndModifier(ctxt); List<Expression> paramList = new ArrayList<Expression>(); if (n == null) { return null; } ctxt.skipBlanks(); if (!ctxt.isOnChar('(')) { ctxt.setPos(startPos); return null; } ctxt.readChar('('); ctxt.skipBlanks(); if (! ctxt.testAndReadChar(')')) { while (true) { Expression paramExpr = PathExpressionChain.parse(ctxt); if (paramExpr == null) { throw new ParseException(ctxt, "')' or method parameter expected."); } paramList.add(paramExpr); ctxt.skipBlanks(); if (ctxt.isOnChar(',')) { ctxt.readChar(','); } else { ctxt.readChar(')'); break; } } } return new MethodCallExpr(ctxt, n, paramList); } private  MethodCallExpr(ParseCtxt ctxt, NameWithModifier nameWithModifier, Collection<Expression> paramExprList); static MethodCallExpr parse(ParseCtxt ctxt); @Override boolean hasNameModifier(Modifier nameModifier); @Override String toString();  }
@Test public void testAccessAbstractMethod() { MethodCallExpr expr = MethodCallExpr.parse(new ParseCtxt("getSomething()")); A aInline = new A() { @Override public String getSomething() { return "inline text"; } }; Assert.assertEquals("inline text", expr.getValue(aInline)); Assert.assertEquals("something from B", expr.getValue(new B())); Assert.assertEquals("something from C", expr.getValue(new C())); Assert.assertEquals("something from B", expr.getValue(new B())); Assert.assertEquals("something from C", expr.getValue(new D())); }