@Override
    public List<Map.Entry<String, String>> entries() {
        if (isEmpty()) {
            return Collections.emptyList();
        }
        List<Map.Entry<String, String>> entries = new ArrayList<Map.Entry<String, String>>(size());
        for (int i = 0; i < nameValuePairs.length; i += 2) {
            entries.add(new SimpleImmutableEntry<String, String>(nameValuePairs[i].toString(),
                    nameValuePairs[i + 1].toString())); // [java/index-out-of-bounds]
        }
        return entries;
    }
@Test
    public void entries() {
        ReadOnlyHttpHeaders headers = new ReadOnlyHttpHeaders(true,
                ACCEPT, APPLICATION_JSON, CONTENT_LENGTH, ZERO, CONNECTION, CLOSE);
        assertFalse(headers.isEmpty());
        assertEquals(3, headers.size());
        assert3ParisEquals(headers.entries().iterator());
    }