ETagHeaderUtils { public static String quote(final String etag) { if (etag.startsWith(WEAK_DESIGNATOR)) { return etag; } else { return "\"" + etag + "\""; } } private  ETagHeaderUtils(); static String quote(final String etag); static String extract(final String etag); static final String WEAK_DESIGNATOR; }
@Test public void quoteStrong() { assertEquals("\"foobar\"", ETagHeaderUtils.quote("foobar")); }
@Test public void quoteWeak() { assertEquals("W/\"foobar\"", ETagHeaderUtils.quote("W/\"foobar\"")); }