public static int compare(String one, String two) {

		if (one == null && two == null) {
			return 0;
		}

		if (one == null) {
			return -1;
		}

		if (two == null) {
			return 1;
		}

		return one.compareTo(two);
	}
public static int compare(String one, String two) {

		if (one == null && two == null) {
			return 0;
		}

		if (one == null) {
			return -1;
		}

		if (two == null) {
			return 1;
		}

		return one.compareTo(two);
	}
public static int compare ( String one , String two ) { if ( one == null && two == null ) { return 0 ; } if ( one == null ) { return - 1 ; } if ( two == null ) { return 1 ; } return one . compareTo ( two ) ; }
Compares two strings with <code>String.compare()</code>. Method allows
<code>null</code> values.

@param one to compare
@param two to compare
@return <b>0</b> if both <code>null</code>, <b>-1</b> if <code>one</code> is <code>null</code>, <b>1</b> if <code>two</code> is <code>null</code>, otherwise <code>String.compare()</code> is
called
Compares two strings with <code > String . compare () < / code > . Method allows <code > null< / code > values .