private static Properties asProperties(OptionSet options, String prefix) { Properties properties = new Properties(); for (Entry<OptionSpec<?>, List<?>> entry : options.asMap().entrySet()) { OptionSpec<?> spec = entry.getKey(); properties.setProperty( asPropertyKey(prefix, spec), asPropertyValue(entry.getValue(), options.has(spec))); } return properties; }