public class OptionHandlerUtil {
/** Generate a key for an {@link OptionHandlerFactory} in Guice. */
@SuppressWarnings("unchecked")
public static <T> Key<OptionHandlerFactory<T>> keyFor(final Class<T> valueType) {
final Type factoryType =
new ParameterizedTypeImpl(null, OptionHandlerFactory.class, valueType);
return (Key<OptionHandlerFactory<T>>) Key.get(TypeLiteral.get(factoryType));
}