Returns the AssertMore condition represented by the given JSON object or an empty
value if no such condition is found.
498267
private static Optional<ICondition> asMoreThan( JsonObject json)
    {
    return
      Optional.of( json)
      .filter( j -> j.containsKey( MORE_THAN_KEY))
      .map( j -> j.getJsonObject( MORE_THAN_KEY))
      .map( a -> new AssertMore( a.getString( PROPERTY_KEY), a.getInt( MIN_KEY)));
    }
1030234
function isEmpty(obj) {
    var empty = false;

    if (isFalsy(obj)) {
        empty = true;
    } else if (isArray(obj)) {
        empty = obj.length === 0;
    } else if (isObject(obj)) {
        empty = Object.keys(obj).length === 0;
    }

    return empty;
}
200931
function assertTlsOptionsAreEqual(optionName, queryString, queryStringKeys) {
  const queryStringHasTLSOption = queryStringKeys.indexOf(optionName) !== -1;

  let optionValue;
  if (Array.isArray(queryString[optionName])) {
    optionValue = queryString[optionName][0];
  } else {
    optionValue = queryString[optionName];
  }

  if (queryStringHasTLSOption) {
    if (Array.isArray(queryString[optionName])) {
      const firstValue = queryString[optionName][0];
      queryString[optionName].forEach(tlsValue => {
        if (tlsValue !== firstValue) {
          throw new MongoParseError('All values of ${optionName} must be the same.');
        }
      });
    }
  }

  return optionValue;
}
1317236
private static Optional<ICondition> asAllOf( JsonObject json)
    {
    return
      json.containsKey( ALL_OF_KEY)
      ? Optional.of( new AllOf( toConditions( json.getJsonArray( ALL_OF_KEY))))
      : Optional.empty();
    }
1354503
function assertEquals(assert, actual, expected, message) {
  const assertionType = Symbol.for('@@meta:magical:assertion-type');
  const rest          = Symbol.for('@@meta:magical:assertion-rest');
  const keys          = Object.keys;

  function isSetoid(value) {
    return value
    &&     typeof value.equals === 'function';
  }

  function isRecord(value) {
    return value
    &&     value[assertionType] === 'record';
  }

  function check(predicate, ...values) {
    return values.every(predicate);
  }

  function getSpecialArrayLength(array) {
    const rests = array.map((x, i) => [x, i]).filter(pair => pair[0] === rest);
    if (rests.length > 1 || (rests[0] && rests[0][1] !== array.length - 1)) {
      assert.ok(false, `${message}. Assertions only support a single trailing rest indication for arrays currently.`);
    }
    return (rests[0] || [null, array.length])[1];
  }

  function compareArrays(left, right) {
    const expectedLength = getSpecialArrayLength(right);
    assert.ok(Array.isArray(left), `${message}. The LHS is not an array.`);
    if (left.length < expectedLength) {
      assert.ok(false, `${message}. The LHS does not have the minimum expected length (${left.length} < ${expectedLength})`);
    }
    for (let i = 0; i < expectedLength; ++i) {
      compare(left[i], right[i]);
    }
  }

  function compareRecord(left, right) {
    const isPartial = right[rest];
    assert.ok(Object(left) === left, message);
    if (!isPartial) {
      assert.deepStrictEqual(keys(left).sort(), keys(right).sort(), `${message}. The objects have different keys ([${keys(left).sort().join(', ')}] vs. [${keys(right).sort().join(', ')}])`);
    }
    Object.keys(right).forEach(key => {
      if (!(key in left)) {
        assert.ok(false, `${message}. The expected key ${key} is not present in the actual object.`);
      }
      compare(left[key], right[key]);
    });
  }


  function compare(l, r) {
    return check(isSetoid, l, r)  ?  assert.ok(l.equals(r), `${message}. The LHS (${l}) setoid instance says the LHS and RHS (${r}) are not equal.`)
    :      Array.isArray(r)       ?  compareArrays(l, r)
    :      isRecord(r)            ?  compareRecord(l, r)
    :      /* otherwise */           assert.deepStrictEqual(l, r, `${message}. The LHS (${l}) and the RHS (${r}) are not structually equal.`);
  }

  compare(actual, expected);
}
698248
private static Optional<ICondition> asAnyOf( JsonObject json)
    {
    return
      json.containsKey( ANY_OF_KEY)
      ? Optional.of( new AnyOf( toConditions( json.getJsonArray( ANY_OF_KEY))))
      : Optional.empty();
    }
480401
static public void assertNull(Object object) {
    		String message = "Expected: <null> but was: " + String.valueOf(object);
    		assertNull(message, object);
    	}
17779
function isEmpty(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled &&
        ((typeof value === 'string' && value.length === 0) ||
            (typeof value === 'number' && value === 0))) {
        throw LogicException.throw(assertionTypes.IS_EMPTY, value, message, id);
    }
}
861773
public static void assertJsonPartNotEquals(Object expected, Object fullJson, String path, Configuration configuration) {
        Diff diff = create(expected, fullJson, FULL_JSON, path, configuration);
        if (diff.similar()) {
            if (ROOT.equals(path)) {
                doFail("Expected different values but the values were equal.");
            } else {
                doFail(String.format("Expected different values in node \"%s\" but the values were equal.", path));
            }
        }
    }
249666
@Deprecated
    public static void assertJsonStructureEquals(Object expected, Object actual) {
        Diff diff = create(expected, actual, ACTUAL, ROOT, configuration.withOptions(COMPARING_ONLY_STRUCTURE));
        diff.failIfDifferent();
    }
170845
function isEmptyObj(object) {
    if(object === undefined)
        return true;

    var objToSend = JSON.parse(JSON.stringify(object));
    var result = nestedEmptyCheck(objToSend);
    if(JSON.stringify(result).indexOf('false') > -1)
        return false;
    return true;
}
1134322
@Nonnull
  public static <T> T assertNotNull(@Nullable final T object) {
    return assertNotNull(null, object);
  }
160358
public static boolean isNull( Object obj ) {
      if( obj instanceof JSONObject ){
         return ((JSONObject) obj).isNullObject();
      }
      return JSONNull.getInstance()
            .equals( obj );
   }
830772
function(json, keyVal) {
            for (var k in keyVal) {
                if (keyVal.hasOwnProperty(k))
                    if (!jsonQ.identical(keyVal[k], json[k])) return false;
            }
            return true;
        }
884054
@Override
    public JsonAssert isNotNull() {
        isPresent("not null");
        Node node = getNode(actual, "");
        if (node.getNodeType() == NULL) {
            failOnType(node, "not null");
        }
        return this;
    }
562939
public static void assertNull(Object object, String message) {
		if (imp != null && object != null) {
			imp.assertFailed(message);
		}
	}
1268728
private void verifyKeyExistenceMatchesExpectation(JsonObject jsonDataToValidate) {
        boolean jsonDataContainsKey = jsonDataToValidate.containsKey(validationKey);
        if (expCheckType == JsonCheckType.KEY_DOES_NOT_EXIST) {
            assertFalse("The provided content contains a \"" + validationKey + "\" key but should not. The content to validate was: [" + jsonDataToValidate + "].", jsonDataContainsKey);
        } else {
            assertTrue("The provided content does not contain a \"" + validationKey + "\" key but should. The content to validate was: [" + jsonDataToValidate + "].", jsonDataContainsKey);
        }
    }