DefaultProxyConnectProtocol extends AbstractProxyProtocol<ProxyConnectProtocolParser> implements ProxyConnectProtocol { @Override public void removeCompressOptionIfExist() { DefaultProxyContentParser contentParser = (DefaultProxyContentParser) getParser().getProxyOptionParser(PROXY_OPTION.CONTENT); if(contentParser == null) { return; } if(ProxyContentParser.ContentType.COMPRESS.equals(contentParser.getContentType())) { getParser().removeProxyOptionParser(contentParser); } } DefaultProxyConnectProtocol(ProxyConnectProtocolParser parser); @Override List<ProxyEndpoint> nextEndpoints(); @Override void recordForwardFor(InetSocketAddress address); @Override String getForwardFor(); @Override void setContent(String content); @Override String getContent(); @Override String getRouteInfo(); @Override String getFinalStation(); @Override String getSource(); @Override boolean isCompressed(); @Override CompressAlgorithm getCompressAlgorithm(); @Override void removeCompressOptionIfExist(); @Override void addCompression(CompressAlgorithm algorithm); @Override String toString();  }
@Test public void testRemoveCompressOptionIfExist() { DefaultProxyConnectProtocolParser parser = new DefaultProxyConnectProtocolParser(); DefaultProxyConnectProtocol protocol = (DefaultProxyConnectProtocol) parser.read("PROXY ROUTE PROXYTLS: Assert.assertTrue(protocol.isCompressed()); protocol.removeCompressOptionIfExist(); Assert.assertFalse(protocol.isCompressed()); }