hashcode compatible to java versions prior to 8