final String[] newArgs = Arrays.copyOf(args, args.length + 2);
newArgs[newArgs.length - 2] = "--credentials";
newArgs[newArgs.length - 1] = "/path/to/aws.properties";
final OptionSet optionSet = optionsParser.parse(newArgs);
assertTrue("Option 'credentials' not found in " + Arrays.deepToString(optionSet.specs().toArray()),
optionSet.has("credentials"));
assertEquals("Value of option 'credentials' not found in " + Arrays.deepToString(optionSet.specs().toArray()),
new File("/path/to/aws.properties"), optionSet.valueOf("credentials"));
}