Here you can find the source of hashCode(Object value)
public static int hashCode(Object value)
//package com.java2s; //License from project: Apache License public class Main { public static int hashCode(Object value) { return value != null ? value.hashCode() : 0; }//from w w w . j av a2 s . com public static int hashCode(double value) { long bits = Double.doubleToLongBits(value); return (int) (bits ^ (bits >>> 32)); } public static int hashCode(long value) { return (int) (value ^ (value >>> 32)); } public static int hashCode(boolean value) { return value ? 1231 : 1237; } }