Why we can not do it one line instead of 6? assertEquals(1, retrieveNamedValue(new Cmd1(1), "id"));