Java tutorial
//package com.java2s; import android.support.annotation.Nullable; public class Main { public static boolean stringsEqual(@Nullable String one, @Nullable String another, boolean ignoreCase) { return !(one != null ? (!ignoreCase ? !one.equals(another) : !one.equalsIgnoreCase(another)) : another != null); } }