use jdk7 Objects.equals and Objects.hashCode; fix test case