Backported Java 8 API.