@Provides
private EventHubHandler getEventHubHandler(Injector injector, EventHub eventHub)
throws ClassNotFoundException {
Map<String, Provider<Command>> commandsMap = Maps.newHashMap();
Reflections reflections = new Reflections(PACKAGE_NAME);
Set<Class<? extends Command>> commandClasses = reflections.getSubTypesOf(Command.class);
for (Class<? extends Command> commandClass : commandClasses) {
String path = commandClass.getAnnotation(Path.class).value();
//noinspection unchecked
commandsMap.put(path, (Provider<Command>) injector.getProvider(commandClass));
}