Fix compile error when compiling on Java 8.

Signed-off-by: Timo Kinnunen <timo.kinnunen@gmail.com>