Backport Java 8.