YuiCssCompressor implements AssetCompressor { @Override public String compress(String source, String name) throws IOException { StringReader input = new StringReader(source); CssCompressor compressor = new CssCompressor(input); StringWriter out = new StringWriter(); compressor.compress(out, -1); return out.toString(); }  @Override String compress(String source, String name);  }
@Test public void testCompress() throws Exception { String uncompressed = TestingUtil.readFile(getClass(), "uncompressed.css.txt"); String expected = TestingUtil.readFile(getClass(), "YuiCssCompressorTest_compressed.css.txt"); YuiCssCompressor packager = new YuiCssCompressor(); String compressed = packager.compress(uncompressed, "uncompressed.css.txt"); assertEquals(expected, compressed); }