CompressionDelegate extends Delegate { public List<CompressionMethod> getCompressionMethods() { if (compressionMethods == null) { return null; } return Collections.unmodifiableList(compressionMethods); } CompressionDelegate(); List<CompressionMethod> getCompressionMethods(); void setCompressionMethods(List<CompressionMethod> compressionMethods); @Override void applyDelegate(Config config);  }
@Test public void testGetCompressionMethods() { args = new String[2]; args[0] = "-compression"; args[1] = "NULL,DEFLATE"; jcommander.parse(args); assertTrue("NULL should get parsed correctly", delegate.getCompressionMethods() .contains(CompressionMethod.NULL)); assertTrue("DEFLATE should get parsed correctly", delegate.getCompressionMethods().contains(CompressionMethod.DEFLATE)); }