new BasicHeader("yellow", "0d"),
new BasicHeader("orange", "0e"),
};
// without filter
HeaderIterator hit = new BasicHeaderIterator(headers, null);
assertTrue(hit.hasNext());
assertEquals("0", headers[0], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("1", headers[1], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("2", headers[2], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("3", headers[3], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("4", headers[4], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("5", headers[5], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("6", headers[6], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("7", headers[7], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("8", headers[8], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("9", headers[9], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("a", headers[10], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("b", headers[11], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("c", headers[12], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("d", headers[13], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("e", headers[14], hit.nextHeader());
assertFalse(hit.hasNext());
// yellow 0, 5, 9, 11, 13
hit = new BasicHeaderIterator(headers, "Yellow");
assertTrue(hit.hasNext());
assertEquals("0", headers[0], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("5", headers[5], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("9", headers[9], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("b", headers[11], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("d", headers[13], hit.nextHeader());
assertFalse(hit.hasNext());
// maroon 1, 6, 7, 8, 10
hit = new BasicHeaderIterator(headers, "marOOn");
assertTrue(hit.hasNext());
assertEquals("1", headers[1], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("6", headers[6], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("7", headers[7], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("8", headers[8], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("a", headers[10], hit.nextHeader());
assertFalse(hit.hasNext());
// orange 2, 3, 4, 12, 14
hit = new BasicHeaderIterator(headers, "OranGe");
assertTrue(hit.hasNext());
assertEquals("2", headers[2], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("3", headers[3], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("4", headers[4], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("b", headers[12], hit.nextHeader());
assertTrue(hit.hasNext());
assertEquals("e", headers[14], hit.nextHeader());
assertFalse(hit.hasNext());
}