/**
* Test the {@link HeaderReader#addValues(java.util.Collection)} method.
*/
public void testAddValues() {
List<Encoding> list = new ArrayList<Encoding>();
new EncodingReader("gzip,deflate").addValues(list);
assertEquals(list.size(), 2);
assertEquals(list.get(0), Encoding.GZIP);
assertEquals(list.get(1), Encoding.DEFLATE);
list = new ArrayList<Encoding>();
new EncodingReader("gzip,identity, deflate").addValues(list);
assertEquals(list.size(), 2);
assertEquals(list.get(0), Encoding.GZIP);
assertEquals(list.get(1), Encoding.DEFLATE);
list = new ArrayList<Encoding>();
new EncodingReader("identity").addValues(list);
assertTrue(list.isEmpty());
list = new ArrayList<Encoding>();
new EncodingReader("identity,").addValues(list);
assertTrue(list.isEmpty());
list = new ArrayList<Encoding>();
new EncodingReader("").addValues(list);
assertTrue(list.isEmpty());
list = new ArrayList<Encoding>();
new EncodingReader(null).addValues(list);
assertTrue(list.isEmpty());
TokenReader tr = new TokenReader("bytes");
List<String> l = tr.readValues();
assertTrue(l.contains("bytes"));