@Mock public int computeX(Invocation inv, int a, int b) { inputValues.add(a); inputValues.add(b); int x = inv.proceed(); outputValues.add(x); return x; }
@Mock public int computeX(Invocation inv, int a, int b) { Integer x; try { x = inv.proceed(); return x; } finally { // Statements to be executed on exit would be here. //noinspection UnusedAssignment x = a + b; values.add(x); } }
@Mock public String getConfig(Invocation inv) { String config = inv.proceed(); assertNull(config); return "test"; }
@Mock public int computeX(Invocation inv, int a, int b) { values.add(a + b); return inv.proceed(); }