argumentHandler.processArguments(new ArgumentProcessor() {
@Override
public void process(List<String> remaining) throws InvalidArgumentsException {
if (remaining.size() > 0) {
throw new InvalidArgumentsException("The following arguments could not be understood: " + remaining);
}
}
});
} catch (InvalidArgumentsException e) {
System.out.println(e.getMessage());