Removing JDK 8 API usages (mostly in tests)

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>