CommandHelper { public static Class<?> getCommandClass(String commandName) { if (hasCommand(commandName)) { return ExtensionLoader.getExtensionLoader(BaseCommand.class).getExtension(commandName).getClass(); } else { return null; } } private  CommandHelper(); static boolean hasCommand(String commandName); static List<Class<?>> getAllCommandClass(); static Class<?> getCommandClass(String commandName);  }
@Test public void testGetCommandClass() throws Exception { assertThat(CommandHelper.getCommandClass("greeting"), equalTo(GreetingCommand.class)); assertNull(CommandHelper.getCommandClass("not-exiting")); }