@SuppressWarnings("unchecked")
private Collection<String> getAliases(Tool<?, ?> toolInstance) throws InvalidToolException {
try {
return (Collection<String>) ALIASES_METHOD.invoke(toolInstance);
} catch (IllegalArgumentException e) {
throw new InvalidToolException(e, "Unable to register {0} tool, unable to get aliases.", toolInstance.getClass()
.getName());
} catch (IllegalAccessException e) {
throw new InvalidToolException(e, "Unable to register {0} tool, unable to get aliases.", toolInstance.getClass()
.getName());
} catch (InvocationTargetException e) {
throw new InvalidToolException(e, "Unable to register {0} tool, unable to get aliases.", toolInstance.getClass()
.getName());
}
}