Example usage for org.springframework.util CollectionUtils toIterator

List of usage examples for org.springframework.util CollectionUtils toIterator

Introduction

In this page you can find the example usage for org.springframework.util CollectionUtils toIterator.

Prototype

public static <E> Iterator<E> toIterator(@Nullable Enumeration<E> enumeration) 

Source Link

Document

Adapt an Enumeration to an Iterator .

Usage

From source file:io.mandrel.MockMvcUtils.java

public static void print(ResultActions result) throws IOException, UnsupportedEncodingException {
    System.err.println(IOUtils.toString(result.andReturn().getRequest().getInputStream()));
    CollectionUtils.toIterator(result.andReturn().getRequest().getHeaderNames())
            .forEachRemaining(h -> System.err.println(h + ":" + result.andReturn().getRequest().getHeader(h)));

    System.err.println(result.andReturn().getResponse().getContentAsString());
    result.andReturn().getResponse().getHeaderNames()
            .forEach(h -> System.err.println(h + ":" + result.andReturn().getResponse().getHeader(h)));
}