Skip to content

Instantly share code, notes, and snippets.

@javiergamarra
Last active December 31, 2015 10:39
Show Gist options
  • Save javiergamarra/7974313 to your computer and use it in GitHub Desktop.
Save javiergamarra/7974313 to your computer and use it in GitHub Desktop.
OptionalInt result = numbers.stream().filter(this::isEven)
.mapToInt(this::doubleIt).filter(this::isGreaterThan5)
.findFirst();
System.out.println("first number is " + result.getAsInt());
assertThat(result.getAsInt(), equalTo(8));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment