Fix broken check (on java8, but okay on java7).