void (String className, String methodName) { try { final Object data = getData(); Method testStarted = data.getClass().getMethod("testDiscoveryStarted", String.class, String.class); testStarted.invoke(data, className, methodName); } catch (Throwable t) { t.printStackTrace(); } }