@Test
public void writeFieldExistsCheckConditionTest() throws Exception {

    FieldPath fieldPath = PostgresFieldPath.fromString("isNull");
    QueryStatement queryStatementIsNull = new QueryStatement();
    resolver
            .resolve("$isNull")
            .write(queryStatementIsNull, resolver, fieldPath, "true");
    assertEquals(queryStatementIsNull.getBodyWriter().toString().trim(), "(document#>'{isNull}') is null");
    QueryStatement queryStatementIsNotNull = new QueryStatement();
    resolver
            .resolve("$isNull")
            .write(queryStatementIsNotNull, resolver, fieldPath, "false");
    assertEquals(queryStatementIsNotNull.getBodyWriter().toString().trim(), "(document#>'{isNull}') is not null");
}