Kengo's blog

Technical articles about original projects, JVM, Static Analysis and JavaScript.

How to migrate Java 7 with Guava to Java 8

replace Optional with java.util.Optional

  • replace import com.google.common.base.Optional; with import java.util.Optional;
  • replace Optional.fromNull() with Optional.ofNull()
  • replace Optional.absent() with Optional.empty()
  • replace Optional.transform() with Optional.map()
  • replace Optional.or() with Optional.orElse()

replace FluentIterable with Stream

upgrade Lombok project to the latest version

1.12.6 didn't work with Eclipse Luna in my case, and 1.14.2 was OK.