Lambda 2.3.3:
run this as JUnit test:
class Foo {
Bar getBar() {
return new Bar();
}
}
class Bar implements Iterable<String> {
@Override
public Iterator<String> iterator() {
return java.util.Arrays.asList("A").iterator();
}
}
@Test
public void shouldCollectIterables() {
List<Foo> foos = java.util.Arrays.asList(new Foo(), new Foo());
List<Bar> bars = Lambda.collect(foos, Lambda.on(Foo.class).getBar());
for (Object bar : bars) {
Assert.assertEquals(Bar.class, bar.getClass());
}
}
Looks like lambda is going inside iterable if it's a result of collect method,
which is unexpected.
Original issue reported on code.google.com by tomasz.b...@pragmatists.pl on 6 Feb 2012 at 10:57
Original issue reported on code.google.com by
tomasz.b...@pragmatists.pl
on 6 Feb 2012 at 10:57