void (Description description) { Config config = description.getAnnotation(Config.class); if (config != null) { myConfig = config; } else { try { myConfig = BulkChangesMergerTest.class.getMethod("dummy").getAnnotation(Config.class); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } } }