private int compareValueWithWildcards(String s1, String s2) {
      if (s1 == null) {
        if (s2 == null) {
          return 0;
        } else {
          return -1;
        }
      } else if (s2 == null) {
        return 1;
      } else if (s1.equals(s2)) {
        return 0;
      } else if (s1.equals(".*")) {
        return 1;
      } else if (s2.equals(".*")) {
        return -1;
      } else {
        return s1.compareTo(s2);
      }
    }
Compares 2 strings for use in compareTo methods but orders <code>null</code>s first and wildcards last.
<p/>
Rules:
<ul>
<li><code>null</code> is ordered before any other string except for <code>null</code>, which is considered be equal</li>
<li><code>.*</code> is ordered after any other string except for <code>.*</code>, which is considered equal</li>
<li>All other values are order based on the result of {@link String#compareTo(String)}</li>
</ul>

@param s1 the first string to be compared.
@param s2 the second string to be compared.
@return a negative integer, zero, or a positive integer as the first argument is less than,
equal to, or greater than the second.
@see Comparable#compareTo(Object)
ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java