CompressParser implements ProxyContentParser.SubOptionParser { @Override public ProxyContentParser.SubOptionParser parse(String... subOption) { if(subOption.length < 2) { throw new IllegalArgumentException(String.format("Compress Option not correct %s", Arrays.deepToString(subOption))); } algorithm = new CompressAlgorithm() { @Override public String version() { return subOption[1]; } @Override public AlgorithmType getType() { return AlgorithmType.valueOf(subOption[0]); } }; return this; }  @Override String output(); @Override ProxyContentParser.SubOptionParser parse(String... subOption); @Override boolean isImportant(); CompressAlgorithm getAlgorithm(); CompressParser setAlgorithm(CompressAlgorithm algorithm);  }
@Test public void testParse() { parser = (CompressParser) parser.parse(new String[]{"ZSTD", "1.0"}); Assert.assertEquals(CompressAlgorithm.AlgorithmType.ZSTD, parser.getAlgorithm().getType()); Assert.assertEquals("1.0", parser.getAlgorithm().version()); }