function virtEquals(obj, other) {
    if (obj === null || other === null) {
      return (obj === null) && (other === null);
    } else if (obj.constructor === String) {
      return obj === other;
    } else if (typeof(obj) !== "object") {
      return obj === other;
    } else if (obj.equals instanceof Function) {
      return obj.equals(other);
    } else {
      return obj === other;
    }
  }
Returns Java equals() result for two objects. If the first object
has the "equals" function, it preforms the call of this function.
Otherwise the method uses the JavaScript === operator.

@param {Object} obj          The first object.
@param {Object} other        The second object.

@returns {boolean}           true if the objects are equal.