fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.stream.Stream;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. Stream.of("one", "two", "three")
  11. .filter(s -> s.contains("x"))
  12. .filter(s -> {
  13. throw new RuntimeException("oh-oh");
  14. })
  15. .forEach(System.out::println);
  16. System.out.println("second filter not hit");
  17. }
  18. }
Success #stdin #stdout 0.1s 34160KB
stdin
Standard input is empty
stdout
second filter not hit