private Statement getOriginalStatement(Statement methodInvoker, Field field) { field.setAccessible(true); try { return (Statement) field.get(methodInvoker); } catch (Exception e) { e.printStackTrace(); return null; } }
private Statement statementOrNull(Statement methodInvoker, Field field) { if (field.getType().isAssignableFrom(Statement.class)) return getOriginalStatement(methodInvoker, field); return null; }