Example 4 (with Method Reference)

package jdk8.byte_code;

import static jdk8.byte_code.Server.HttpServer;
import static jdk8.byte_code.WaitFor.waitFor;

@SuppressWarnings("all")
public class Example4_method_reference {
    // lambda with method reference
    void example() throws InterruptedException {
        waitFor(new HttpServer(), HttpServer::isRunning);
    }

}
Classfile Example4_method_reference.class Last modified 08-May-2014; size 1271 bytes MD5 checksum f8aef942361f29ef599adfec7a594948 Compiled from "Example4_method_reference.java" public class jdk8.byte_code.Example4_method_reference SourceFile: "Example4_method_reference.java" InnerClasses: public static #23= #2 of #21; //HttpServer=class jdk8/byte_code/Server$HttpServer of class jdk8/byte_code/Server ...

Get Learning Java Lambdas now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.