EventImplUtils { public static Class<? extends Event> getClassForType(EventType type) { switch (type) { case EXECUTION_START: return TestExecutionStartImpl.class; case EXECUTION_FINISH: return TestExecutionFinishImpl.class; case TEST_SUITE_START: return TestSuiteStartImpl.class; case TEST_SUITE_FINISH: return TestSuiteFinishImpl.class; case TEST_CASE_START: return TestCaseStartImpl.class; case TEST_CASE_FINISH: return TestCaseFinishImpl.class; case TEST_STEP_START: return TestStepStartImpl.class; case TEST_STEP_FINISH: return TestStepFinishImpl.class; case ACTION: return ActionImpl.class; case TEST_LOG: return LogImpl.class; case JOB_SCHEDULED: return JobScheduledImpl.class; case ATTACHMENT: return AttachmentImpl.class; case COMMIT: return CommitImpl.class; case ENVIRONMENT_BROKEN: return EnvironmentBrokenImpl.class; case ENVIRONMENT_UNDER_TESTS: return EnvironmentUnderTest.class; case ENVIRONMENT_WORKING: return EnvironmentWorkingImpl.class; case SAMPLE: return SampleImpl.class; default: throw new IllegalArgumentException(String.format("Type %s unrecognized", type)); } }  static Class<? extends Event> getClassForType(EventType type);  }
@Test public void classFetching() { System.out.println(EventImplUtils.getClassForType(EventType.ACTION)); System.out.println(EventImplUtils.getClassForType(EventType.JOB_SCHEDULED)); }