Skip to content

Instantly share code, notes, and snippets.

@damithadayananda
Created September 18, 2020 12:08
Show Gist options
  • Save damithadayananda/2432f2714bce6fb604cd9cacc3649732 to your computer and use it in GitHub Desktop.
Save damithadayananda/2432f2714bce6fb604cd9cacc3649732 to your computer and use it in GitHub Desktop.
default Stream<T> takeWhile(Predicate<? super T> predicate)
private Stream stream = Stream.of(1,2,10,3,4,5,6,7,8,9);
stream.takeWhile(x -> (Integer)x < 4).forEach(a -> System.out.println(a));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment