private static boolean areSame ( Credentials c1 , Credentials c2 ) { if ( c1 == null ) { return c2 == null ; } else { return StringUtils . equals ( c1 . getUserPrincipal ( ) . getName ( ) , c1 . getUserPrincipal ( ) . getName ( ) ) && StringUtils . equals ( c1 . getPassword ( ) , c1 . getPassword ( ) ) ; } }
Compare two instances of Credentials .