void (Test test) { try { Object data = getData(); Method testStarted = data.getClass().getMethod("testDiscoveryStarted", String.class, String.class); testStarted.invoke(data, getClassName(test), getMethodName(test)); } catch (Throwable t) { t.printStackTrace(); } }