@Test
public void testReadMultiplePrivateAndNoCacheFields()
{
String s = "private=\"foo1,foo2\",no-store,no-transform,must-revalidate,proxy-revalidate,max-age=2,s-maxage=3,no-cache=\"bar1,bar2\",ext=1";
CacheControl cacheControl = CacheControl.valueOf(s);
assertTrue(cacheControl.isPrivate());
List<String> privateFields = cacheControl.getPrivateFields();
assertEquals(privateFields.size(), 2);
assertEquals(privateFields.get(0), "foo1");
assertEquals(privateFields.get(1), "foo2");
assertTrue(cacheControl.isNoCache());
List<String> noCacheFields = cacheControl.getNoCacheFields();
assertEquals(2, noCacheFields.size());
assertEquals(noCacheFields.get(0), "bar1");
assertEquals(noCacheFields.get(1), "bar2");
assertTrue(cacheControl.isNoStore());
assertTrue(cacheControl.isNoTransform());
assertTrue(cacheControl.isMustRevalidate());
assertTrue(cacheControl.isProxyRevalidate());
assertEquals(cacheControl.getMaxAge(), 2);
assertEquals(cacheControl.getSMaxAge(), 3);
Map<String, String> cacheExtension = cacheControl.getCacheExtension();
assertEquals(cacheExtension.size(), 1);
assertEquals(cacheExtension.get("ext"), "1");
}