@Test
public void simpleStreamTest() {

  MockWebServer server = new MockWebServer();
  server.enqueue(new MockResponse().setBody("foo\nbar"));
  StreamInterface api = Feign.builder()
      .decoder(StreamDecoder.create(
          (response, type) -> new BufferedReader(response.body().asReader(UTF_8)).lines()
              .iterator()))
      .doNotCloseAfterDecode()
      .target(StreamInterface.class, server.url("/").toString());
  try (Stream<String> stream = api.get()) {
    assertThat(stream.collect(Collectors.toList())).isEqualTo(Arrays.asList("foo", "bar"));
  }
}