public static < T > boolean compareInstance ( T t1 , T t2 ) { if ( t1 == t2 ) { return true ; } if ( t1 != null && t2 != null && t1 . equals ( t2 ) ) { return true ; } return false ; }
Compare tow instance . If both are null still equal