Move compareToNullable(...) utility method to Util.