rewrote hashcode using jdk7 methods.