class HttpFields implements Iterable<HttpField> {

    public Enumeration<String> getValues(final String name) {
        for (int i = 0; i < size; i++) {
            final HttpField f = fields[i];

            if (f.getName().equalsIgnoreCase(name) && f.getValue() != null) {
                final int first = i;
                return new Enumeration<String>() {
                    HttpField field = f;
                    int i = first + 1;

                    @Override
                    public boolean hasMoreElements() {
                        if (field == null) {
                            while (i < size) {
                                field = fields[i++];
                                if (field.getName().equalsIgnoreCase(name) && field.getValue() != null)
                                    return true;
                            }
                            field = null;
                            return false;
                        }
                        return true;
                    }

                    @Override
                    public String nextElement() throws NoSuchElementException {
                        if (hasMoreElements()) {
                            String value = field.getValue();
                            field = null;
                            return value;
                        }
                        throw new NoSuchElementException();
                    }
                };
            }
        }

        List<String> empty = Collections.emptyList();
        return Collections.enumeration(empty);
    }

    public  HttpFields();
    public  HttpFields(int capacity);
    public  HttpFields(HttpFields fields);

}