---
policy: /ce/unit-test/contains-all/text
logic: /ce/unit-test/contains-all/text/unit-test.logic.yaml
executionTime: 2025-07-03T01:28:07.433791931Z
rows:
  - id: Word-1
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: "unitTest(Word-1): 'abcklmxyz'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())"
      actual: "unitTest(Word-1): 'abcklmxyz'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())"
    runtimeError: {}
  - id: Word-2
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: "unitTest(Word-2): 'abcklmxyz'.containsAll(['abc', 'klm'].skipEmpty().skipDuplicates().sort())"
      actual: "unitTest(Word-2): 'abcklmxyz'.containsAll(['abc', 'klm'].skipEmpty().skipDuplicates().sort())"
    runtimeError: {}
  - id: Word-3
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: "unitTest(Word-3): 'abcklmxyz'.containsAll(['klm', 'xyz'].skipEmpty().skipDuplicates().sort())"
      actual: "unitTest(Word-3): 'abcklmxyz'.containsAll(['klm', 'xyz'].skipEmpty().skipDuplicates().sort())"
    runtimeError: {}
  - id: Word-4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 499
      actual: 499
    conditionText:
      expected: "unitTest(Word-4): not('abcklmxyz'.containsAll(['abc', '123'].skipEmpty().skipDuplicates().sort()))"
      actual: "unitTest(Word-4): not('abcklmxyz'.containsAll(['abc', '123'].skipEmpty().skipDuplicates().sort()))"
    runtimeError: {}
  - id: Multiple-1
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 599
      actual: 599
    conditionText:
      expected: "unitTest(Multiple-1): 'abc klm xyz'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())"
      actual: "unitTest(Multiple-1): 'abc klm xyz'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())"
    runtimeError: {}
  - id: Multiple-2
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 699
      actual: 699
    conditionText:
      expected: "unitTest(Multiple-2): 'abc klm xyz'.containsAll(['abc', 'klm'].skipEmpty().skipDuplicates().sort())"
      actual: "unitTest(Multiple-2): 'abc klm xyz'.containsAll(['abc', 'klm'].skipEmpty().skipDuplicates().sort())"
    runtimeError: {}
  - id: Multiple-3
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 799
      actual: 799
    conditionText:
      expected: "unitTest(Multiple-3): 'abc klm xyz'.containsAll(['klm', 'xyz'].skipEmpty().skipDuplicates().sort())"
      actual: "unitTest(Multiple-3): 'abc klm xyz'.containsAll(['klm', 'xyz'].skipEmpty().skipDuplicates().sort())"
    runtimeError: {}
  - id: Multiple-4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 899
      actual: 899
    conditionText:
      expected: "unitTest(Multiple-4): not('abc klm xyz'.containsAll(['abc', '123'].skipEmpty().skipDuplicates().sort()))"
      actual: "unitTest(Multiple-4): not('abc klm xyz'.containsAll(['abc', '123'].skipEmpty().skipDuplicates().sort()))"
    runtimeError: {}
  - id: Whitespace-1
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 999
      actual: 999
    conditionText:
      expected: "unitTest(Whitespace-1): ' aa   bb  cc '.containsAll(['aa bb', 'bb\
        \ cc'].skipEmpty().skipDuplicates().sort())"
      actual: "unitTest(Whitespace-1): ' aa   bb  cc '.containsAll(['aa bb', 'bb cc'].skipEmpty().skipDuplicates().sort())"
    runtimeError: {}
  - id: Whitespace-2
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1099
      actual: 1099
    conditionText:
      expected: "unitTest(Whitespace-2): 'aa bb cc'.containsAll(['  aa  bb    ', '\
        \    bb   cc '].skipEmpty().skipDuplicates().sort())"
      actual: "unitTest(Whitespace-2): 'aa bb cc'.containsAll(['  aa  bb    ', ' \
        \   bb   cc '].skipEmpty().skipDuplicates().sort())"
    runtimeError: {}
  - id: Whitespace-3
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1199
      actual: 1199
    conditionText:
      expected: "unitTest(Whitespace-3): ''.containsAll(['', ''].keepEmpty().keepDuplicates().sort())"
      actual: "unitTest(Whitespace-3): ''.containsAll(['', ''].keepEmpty().keepDuplicates().sort())"
    runtimeError: {}
  - id: Whitespace-4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1299
      actual: 1299
    conditionText:
      expected: "unitTest(Whitespace-4): 'a b c'.containsAll(['a\\nb', 'b\\n\\tc'].skipEmpty().skipDuplicates().sort())"
      actual: "unitTest(Whitespace-4): 'a b c'.containsAll(['a\\nb', 'b\\n\\tc'].skipEmpty().skipDuplicates().sort())"
    runtimeError: {}
  - id: Case-1
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1399
      actual: 1399
    conditionText:
      expected: "unitTest(Case-1): 'ABC KLM XYZ'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())"
      actual: "unitTest(Case-1): 'ABC KLM XYZ'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())"
    runtimeError: {}
  - id: Null-1
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1499
      actual: 1499
    conditionText:
      expected: "unitTest(Null-1): not(null.containsAll(null))"
      actual: "unitTest(Null-1): not(null.containsAll(null))"
    runtimeError: {}
  - id: Null-2
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1599
      actual: 1599
    conditionText:
      expected: "unitTest(Null-2): not(''.containsAll(null))"
      actual: "unitTest(Null-2): not(''.containsAll(null))"
    runtimeError: {}
  - id: Null-3
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1699
      actual: 1699
    conditionText:
      expected: "unitTest(Null-3): not('abc'.containsAll(null))"
      actual: "unitTest(Null-3): not('abc'.containsAll(null))"
    runtimeError: {}
  - id: Null-4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1799
      actual: 1799
    conditionText:
      expected: "unitTest(Null-4): null.containsAll([''].keepEmpty().keepDuplicates().sort())"
      actual: "unitTest(Null-4): null.containsAll([''].keepEmpty().keepDuplicates().sort())"
    runtimeError: {}
  - id: Null-5
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1899
      actual: 1899
    conditionText:
      expected: "unitTest(Null-5): not(null.containsAll(['abc'].skipEmpty().skipDuplicates().sort()))"
      actual: "unitTest(Null-5): not(null.containsAll(['abc'].skipEmpty().skipDuplicates().sort()))"
    runtimeError: {}
usedFiles:
  - path: /ce/unit-test/contains-all/text/policy.yaml
    md5Hash: B60A86F1D94FD0DFC4AF31618D9BD9F8
    content: |-
      ---
      names:
        full: "CONTAINS_ALL Unit Tests: TextType"
        contextual: TextType
      description: ""
  - path: /ce/unit-test/contains-all/text/unit-test.logic.yaml
    md5Hash: AC556C7594992D5C8079216CA23D8619
    content: |-
      ---
      inputType: CA10__CaAwsInstance__c
      conditions:
        - status: COMPLIANT
          currentStateMessage: Word-1
          check:
            UNIT_TEST:
              id: Word-1
              expected:
                text: "unitTest(Word-1): 'abcklmxyz'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: "abcklmxyz"
                  search:
                    COLLECTION:
                      emptyValues: SKIP
                      duplicateValues: SKIP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - "abc"
                        - "xyz"
        - status: COMPLIANT
          currentStateMessage: Word-2
          check:
            UNIT_TEST:
              id: Word-2
              expected:
                text: "unitTest(Word-2): 'abcklmxyz'.containsAll(['abc', 'klm'].skipEmpty().skipDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: "abcklmxyz"
                  search:
                    COLLECTION:
                      emptyValues: SKIP
                      duplicateValues: SKIP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - "abc"
                        - "klm"
        - status: COMPLIANT
          currentStateMessage: Word-3
          check:
            UNIT_TEST:
              id: Word-3
              expected:
                text: "unitTest(Word-3): 'abcklmxyz'.containsAll(['klm', 'xyz'].skipEmpty().skipDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: "abcklmxyz"
                  search:
                    COLLECTION:
                      emptyValues: SKIP
                      duplicateValues: SKIP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - "klm"
                        - "xyz"
        - status: COMPLIANT
          currentStateMessage: Word-4
          check:
            UNIT_TEST:
              id: Word-4
              expected:
                text: "unitTest(Word-4): not('abcklmxyz'.containsAll(['abc', '123'].skipEmpty().skipDuplicates().sort()))"
              arg:
                NOT:
                  arg:
                    CONTAINS_ALL:
                      arg:
                        TEXT: "abcklmxyz"
                      search:
                        COLLECTION:
                          emptyValues: SKIP
                          duplicateValues: SKIP
                          ordering: SORTED
                          itemType: TEXT
                          items:
                            - "abc"
                            - "123"
        - status: COMPLIANT
          currentStateMessage: Multiple-1
          check:
            UNIT_TEST:
              id: Multiple-1
              expected:
                text: "unitTest(Multiple-1): 'abc klm xyz'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: "abc klm xyz"
                  search:
                    COLLECTION:
                      emptyValues: SKIP
                      duplicateValues: SKIP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - "abc"
                        - "xyz"
        - status: COMPLIANT
          currentStateMessage: Multiple-2
          check:
            UNIT_TEST:
              id: Multiple-2
              expected:
                text: "unitTest(Multiple-2): 'abc klm xyz'.containsAll(['abc', 'klm'].skipEmpty().skipDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: "abc klm xyz"
                  search:
                    COLLECTION:
                      emptyValues: SKIP
                      duplicateValues: SKIP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - "abc"
                        - "klm"
        - status: COMPLIANT
          currentStateMessage: Multiple-3
          check:
            UNIT_TEST:
              id: Multiple-3
              expected:
                text: "unitTest(Multiple-3): 'abc klm xyz'.containsAll(['klm', 'xyz'].skipEmpty().skipDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: "abc klm xyz"
                  search:
                    COLLECTION:
                      emptyValues: SKIP
                      duplicateValues: SKIP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - "klm"
                        - "xyz"
        - status: COMPLIANT
          currentStateMessage: Multiple-4
          check:
            UNIT_TEST:
              id: Multiple-4
              expected:
                text: "unitTest(Multiple-4): not('abc klm xyz'.containsAll(['abc', '123'].skipEmpty().skipDuplicates().sort()))"
              arg:
                NOT:
                  arg:
                    CONTAINS_ALL:
                      arg:
                        TEXT: "abc klm xyz"
                      search:
                        COLLECTION:
                          emptyValues: SKIP
                          duplicateValues: SKIP
                          ordering: SORTED
                          itemType: TEXT
                          items:
                            - "abc"
                            - "123"
        - status: COMPLIANT
          currentStateMessage: Whitespace-1
          check:
            UNIT_TEST:
              id: Whitespace-1
              expected:
                text: "unitTest(Whitespace-1): ' aa   bb  cc '.containsAll(['aa bb', 'bb cc'].skipEmpty().skipDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: " aa   bb  cc "
                  search:
                    COLLECTION:
                      emptyValues: SKIP
                      duplicateValues: SKIP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - "aa bb"
                        - "bb cc"
        - status: COMPLIANT
          currentStateMessage: Whitespace-2
          check:
            UNIT_TEST:
              id: Whitespace-2
              expected:
                text: "unitTest(Whitespace-2): 'aa bb cc'.containsAll(['  aa  bb    ', '    bb   cc '].skipEmpty().skipDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: "aa bb cc"
                  search:
                    COLLECTION:
                      emptyValues: SKIP
                      duplicateValues: SKIP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - "  aa  bb    "
                        - "    bb   cc "
        - status: COMPLIANT
          currentStateMessage: Whitespace-3
          check:
            UNIT_TEST:
              id: Whitespace-3
              expected:
                text: "unitTest(Whitespace-3): ''.containsAll(['', ''].keepEmpty().keepDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: ""
                  search:
                    COLLECTION:
                      emptyValues: KEEP
                      duplicateValues: KEEP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - ""
                        - ""
        - status: COMPLIANT
          currentStateMessage: Whitespace-4
          check:
            UNIT_TEST:
              id: Whitespace-4
              expected:
                text: "unitTest(Whitespace-4): 'a b c'.containsAll(['a\\nb', 'b\\n\\tc'].skipEmpty().skipDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: "a b c"
                  search:
                    COLLECTION:
                      emptyValues: SKIP
                      duplicateValues: SKIP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - "a\nb"
                        - "b\n\tc"
        - status: COMPLIANT
          currentStateMessage: Case-1
          check:
            UNIT_TEST:
              id: Case-1
              expected:
                text: "unitTest(Case-1): 'ABC KLM XYZ'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    TEXT: "ABC KLM XYZ"
                  search:
                    COLLECTION:
                      emptyValues: SKIP
                      duplicateValues: SKIP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - "abc"
                        - "xyz"
        - status: COMPLIANT
          currentStateMessage: Null-1
          check:
            UNIT_TEST:
              id: Null-1
              expected:
                text: "unitTest(Null-1): not(null.containsAll(null))"
              arg:
                NOT:
                  arg:
                    CONTAINS_ALL:
                      arg:
                        UNIT_TEST_NULL:
                          returnType: TEXT
                      search:
                        UNIT_TEST_NULL:
                          returnType: COLLECTION_TEXT
        - status: COMPLIANT
          currentStateMessage: Null-2
          check:
            UNIT_TEST:
              id: Null-2
              expected:
                text: "unitTest(Null-2): not(''.containsAll(null))"
              arg:
                NOT:
                  arg:
                    CONTAINS_ALL:
                      arg:
                        TEXT: ""
                      search:
                        UNIT_TEST_NULL:
                          returnType: COLLECTION_TEXT
        - status: COMPLIANT
          currentStateMessage: Null-3
          check:
            UNIT_TEST:
              id: Null-3
              expected:
                text: "unitTest(Null-3): not('abc'.containsAll(null))"
              arg:
                NOT:
                  arg:
                    CONTAINS_ALL:
                      arg:
                        TEXT: "abc"
                      search:
                        UNIT_TEST_NULL:
                          returnType: COLLECTION_TEXT
        - status: COMPLIANT
          currentStateMessage: Null-4
          check:
            UNIT_TEST:
              id: Null-4
              expected:
                text: "unitTest(Null-4): null.containsAll([''].keepEmpty().keepDuplicates().sort())"
              arg:
                CONTAINS_ALL:
                  arg:
                    UNIT_TEST_NULL:
                      returnType: TEXT
                  search:
                    COLLECTION:
                      emptyValues: KEEP
                      duplicateValues: KEEP
                      ordering: SORTED
                      itemType: TEXT
                      items:
                        - ""
        - status: COMPLIANT
          currentStateMessage: Null-5
          check:
            UNIT_TEST:
              id: Null-5
              expected:
                text: "unitTest(Null-5): not(null.containsAll(['abc'].skipEmpty().skipDuplicates().sort()))"
              arg:
                NOT:
                  arg:
                    CONTAINS_ALL:
                      arg:
                        UNIT_TEST_NULL:
                          returnType: TEXT
                      search:
                        COLLECTION:
                          emptyValues: SKIP
                          duplicateValues: SKIP
                          ordering: SORTED
                          itemType: TEXT
                          items:
                            - "abc"
      otherwise:
        status: INCOMPLIANT
        currentStateMessage: Test Failed
        remediationMessage: Developer Fix Required
script: |-
  CREATE TEMP FUNCTION mock_ExpectedResult()
  RETURNS ARRAY<STRUCT<
          Id STRING,
          expectedResult STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, runtimeError STRING>
      >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "Id" : "Word-1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 199,
      "conditionText" : "unitTest(Word-1): 'abcklmxyz'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Word-2",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 299,
      "conditionText" : "unitTest(Word-2): 'abcklmxyz'.containsAll(['abc', 'klm'].skipEmpty().skipDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Word-3",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 399,
      "conditionText" : "unitTest(Word-3): 'abcklmxyz'.containsAll(['klm', 'xyz'].skipEmpty().skipDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Word-4",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 499,
      "conditionText" : "unitTest(Word-4): not('abcklmxyz'.containsAll(['abc', '123'].skipEmpty().skipDuplicates().sort()))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Multiple-1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 599,
      "conditionText" : "unitTest(Multiple-1): 'abc klm xyz'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Multiple-2",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 699,
      "conditionText" : "unitTest(Multiple-2): 'abc klm xyz'.containsAll(['abc', 'klm'].skipEmpty().skipDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Multiple-3",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 799,
      "conditionText" : "unitTest(Multiple-3): 'abc klm xyz'.containsAll(['klm', 'xyz'].skipEmpty().skipDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Multiple-4",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 899,
      "conditionText" : "unitTest(Multiple-4): not('abc klm xyz'.containsAll(['abc', '123'].skipEmpty().skipDuplicates().sort()))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Whitespace-1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 999,
      "conditionText" : "unitTest(Whitespace-1): ' aa   bb  cc '.containsAll(['aa bb', 'bb cc'].skipEmpty().skipDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Whitespace-2",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1099,
      "conditionText" : "unitTest(Whitespace-2): 'aa bb cc'.containsAll(['  aa  bb    ', '    bb   cc '].skipEmpty().skipDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Whitespace-3",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1199,
      "conditionText" : "unitTest(Whitespace-3): ''.containsAll(['', ''].keepEmpty().keepDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Whitespace-4",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1299,
      "conditionText" : "unitTest(Whitespace-4): 'a b c'.containsAll(['a\\nb', 'b\\n\\tc'].skipEmpty().skipDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Case-1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1399,
      "conditionText" : "unitTest(Case-1): 'ABC KLM XYZ'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Null-1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1499,
      "conditionText" : "unitTest(Null-1): not(null.containsAll(null))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Null-2",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1599,
      "conditionText" : "unitTest(Null-2): not(''.containsAll(null))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Null-3",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1699,
      "conditionText" : "unitTest(Null-3): not('abc'.containsAll(null))",
      "runtimeError" : null
    }
  }, {
    "Id" : "Null-4",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1799,
      "conditionText" : "unitTest(Null-4): null.containsAll([''].keepEmpty().keepDuplicates().sort())",
      "runtimeError" : null
    }
  }, {
    "Id" : "Null-5",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1899,
      "conditionText" : "unitTest(Null-5): not(null.containsAll(['abc'].skipEmpty().skipDuplicates().sort()))",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaAwsInstance__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Word-1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Word-2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Word-3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Word-4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Multiple-1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Multiple-2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Multiple-3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Multiple-4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Whitespace-1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Whitespace-2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Whitespace-3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Whitespace-4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Case-1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Null-1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Null-2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Null-3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Null-4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Null-5"
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10__CaAwsInstance__c(
      obj STRUCT<
          Id STRING,
          CA10__disappearanceTime__c TIMESTAMP
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var CollectionLib = new function () {
          this.parse = function(arg, separator, skipEmpty, skipDuplicates, sort, normalize) {
              if (arg == null) return [];
              let parts = arg.split(separator);
              return this.fromArray(parts, skipEmpty, skipDuplicates, sort, normalize);
          };
          this.fromArray = function(arr, skipEmpty, skipDuplicates, sort, normalize) {
              if (arr == null) return [];
              let result = [];
              let seen = new Set();
              arr.forEach(el => {
                  if (!skipEmpty || TextLib.isNotEmpty(el)) {
                      let normalized = normalize ? TextLib.normalize(el) : BytesLib.normalize(el);
                      if (!skipDuplicates || !seen.has(normalized)) {
                          if (skipDuplicates) seen.add(normalized);
                          result.push(normalized);
                      }
                  }
              });
              if (sort) result.sort();
              return result;
          };
          this.equal = function(left, right) {
              left = left == null ? [] : left;
              right = right == null ? [] : right;
              if (left.length !== right.length) return false;
              for (let i = 0; i < left.length; i++) {
                  if (left[i] !== right[i]) return false;
              }
              return true;
          };
          this.notEqual = function(left, right) {
              return !this.equal(left, right);
          };
          this.size = function(collection) {
              return collection == null ? 0 : collection.length;
          };
          this.startsWith = function(collection, search, normalize) {
              if (collection == null || collection.length === 0) return false;
              let normalizedSearch = normalize ? TextLib.normalize(search) : BytesLib.normalize(search);
              return collection[0] === normalizedSearch;
          };
          this.endsWith = function(collection, search, normalize) {
              if (collection == null || collection.length === 0) return false;
              let normalizedSearch = normalize ? TextLib.normalize(search) : BytesLib.normalize(search);
              return collection[collection.length - 1] === normalizedSearch;
          };
          this.contains = function(collection, search, normalize) {
              if (collection == null || collection.length === 0) return false;
              return collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search));
          };
          this.containsAll = function(collection, searchArray, normalize) {
              if (collection == null || collection.length === 0 || searchArray == null || searchArray.length === 0) return false;
              return searchArray.every(search => collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search)));
          };
          this.containsAny = function(collection, searchArray, normalize) {
              if (collection == null || collection.length === 0 || searchArray == null || searchArray.length === 0) return false;
              return searchArray.some(search => collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search)));
          };
      }();
      var TextLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg.replace(/\s+/g, ' ').trim().toLowerCase();
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
          this.containsAll = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
          };
          this.containsAny = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
          };
      }();
      var BytesLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg;
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
          this.containsAll = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
          };
          this.containsAny = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
          };
      }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From AWS [CA10__disappearanceTime__c]: ' + obj.CA10__disappearanceTime__c);
      if (obj.CA10__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      if (obj.Id == 'Word-1' && TextLib.containsAll('abcklmxyz', CollectionLib.fromArray(['abc', 'xyz'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "unitTest(Word-1): 'abcklmxyz'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())", currentStateMessage: "Word-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[2], conditionIndex:[200..299]
      if (obj.Id == 'Word-2' && TextLib.containsAll('abcklmxyz', CollectionLib.fromArray(['abc', 'klm'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "unitTest(Word-2): 'abcklmxyz'.containsAll(['abc', 'klm'].skipEmpty().skipDuplicates().sort())", currentStateMessage: "Word-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[3], conditionIndex:[300..399]
      if (obj.Id == 'Word-3' && TextLib.containsAll('abcklmxyz', CollectionLib.fromArray(['klm', 'xyz'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 399, conditionText: "unitTest(Word-3): 'abcklmxyz'.containsAll(['klm', 'xyz'].skipEmpty().skipDuplicates().sort())", currentStateMessage: "Word-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[4], conditionIndex:[400..499]
      if (obj.Id == 'Word-4' && !TextLib.containsAll('abcklmxyz', CollectionLib.fromArray(['abc', '123'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 499, conditionText: "unitTest(Word-4): not('abcklmxyz'.containsAll(['abc', '123'].skipEmpty().skipDuplicates().sort()))", currentStateMessage: "Word-4", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[5], conditionIndex:[500..599]
      if (obj.Id == 'Multiple-1' && TextLib.containsAll('abc klm xyz', CollectionLib.fromArray(['abc', 'xyz'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 599, conditionText: "unitTest(Multiple-1): 'abc klm xyz'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())", currentStateMessage: "Multiple-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[6], conditionIndex:[600..699]
      if (obj.Id == 'Multiple-2' && TextLib.containsAll('abc klm xyz', CollectionLib.fromArray(['abc', 'klm'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 699, conditionText: "unitTest(Multiple-2): 'abc klm xyz'.containsAll(['abc', 'klm'].skipEmpty().skipDuplicates().sort())", currentStateMessage: "Multiple-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[7], conditionIndex:[700..799]
      if (obj.Id == 'Multiple-3' && TextLib.containsAll('abc klm xyz', CollectionLib.fromArray(['klm', 'xyz'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 799, conditionText: "unitTest(Multiple-3): 'abc klm xyz'.containsAll(['klm', 'xyz'].skipEmpty().skipDuplicates().sort())", currentStateMessage: "Multiple-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[8], conditionIndex:[800..899]
      if (obj.Id == 'Multiple-4' && !TextLib.containsAll('abc klm xyz', CollectionLib.fromArray(['abc', '123'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 899, conditionText: "unitTest(Multiple-4): not('abc klm xyz'.containsAll(['abc', '123'].skipEmpty().skipDuplicates().sort()))", currentStateMessage: "Multiple-4", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[9], conditionIndex:[900..999]
      if (obj.Id == 'Whitespace-1' && TextLib.containsAll(' aa   bb  cc ', CollectionLib.fromArray(['aa bb', 'bb cc'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 999, conditionText: "unitTest(Whitespace-1): ' aa   bb  cc '.containsAll(['aa bb', 'bb cc'].skipEmpty().skipDuplicates().sort())", currentStateMessage: "Whitespace-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[10], conditionIndex:[1000..1099]
      if (obj.Id == 'Whitespace-2' && TextLib.containsAll('aa bb cc', CollectionLib.fromArray(['  aa  bb    ', '    bb   cc '], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 1099, conditionText: "unitTest(Whitespace-2): 'aa bb cc'.containsAll(['  aa  bb    ', '    bb   cc '].skipEmpty().skipDuplicates().sort())", currentStateMessage: "Whitespace-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[11], conditionIndex:[1100..1199]
      if (obj.Id == 'Whitespace-3' && TextLib.containsAll('', CollectionLib.fromArray(['', ''], false, false, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 1199, conditionText: "unitTest(Whitespace-3): ''.containsAll(['', ''].keepEmpty().keepDuplicates().sort())", currentStateMessage: "Whitespace-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[12], conditionIndex:[1200..1299]
      if (obj.Id == 'Whitespace-4' && TextLib.containsAll('a b c', CollectionLib.fromArray(['a\nb', 'b\n\tc'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 1299, conditionText: "unitTest(Whitespace-4): 'a b c'.containsAll(['a\\nb', 'b\\n\\tc'].skipEmpty().skipDuplicates().sort())", currentStateMessage: "Whitespace-4", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[13], conditionIndex:[1300..1399]
      if (obj.Id == 'Case-1' && TextLib.containsAll('ABC KLM XYZ', CollectionLib.fromArray(['abc', 'xyz'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 1399, conditionText: "unitTest(Case-1): 'ABC KLM XYZ'.containsAll(['abc', 'xyz'].skipEmpty().skipDuplicates().sort())", currentStateMessage: "Case-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[14], conditionIndex:[1400..1499]
      if (obj.Id == 'Null-1' && !TextLib.containsAll(null, null)) {
          return {status: 'COMPLIANT', conditionIndex: 1499, conditionText: "unitTest(Null-1): not(null.containsAll(null))", currentStateMessage: "Null-1", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[15], conditionIndex:[1500..1599]
      if (obj.Id == 'Null-2' && !TextLib.containsAll('', null)) {
          return {status: 'COMPLIANT', conditionIndex: 1599, conditionText: "unitTest(Null-2): not(''.containsAll(null))", currentStateMessage: "Null-2", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[16], conditionIndex:[1600..1699]
      if (obj.Id == 'Null-3' && !TextLib.containsAll('abc', null)) {
          return {status: 'COMPLIANT', conditionIndex: 1699, conditionText: "unitTest(Null-3): not('abc'.containsAll(null))", currentStateMessage: "Null-3", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[17], conditionIndex:[1700..1799]
      if (obj.Id == 'Null-4' && TextLib.containsAll(null, CollectionLib.fromArray([''], false, false, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 1799, conditionText: "unitTest(Null-4): null.containsAll([''].keepEmpty().keepDuplicates().sort())", currentStateMessage: "Null-4", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[18], conditionIndex:[1800..1899]
      if (obj.Id == 'Null-5' && !TextLib.containsAll(null, CollectionLib.fromArray(['abc'], true, true, true, true))) {
          return {status: 'COMPLIANT', conditionIndex: 1899, conditionText: "unitTest(Null-5): not(null.containsAll(['abc'].skipEmpty().skipDuplicates().sort()))", currentStateMessage: "Null-5", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 1900, conditionText: "otherwise", currentStateMessage: "Test Failed", currentStateReferences: references1.join('\n'), remediation: "Developer Fix Required", runtimeError: null};
  """;


  SELECT
    expectedResult.Id as Id,
    IF (
      IFNULL(expectedResult.expectedResult.status, '') = IFNULL(sObject.result.status, '')
      AND IFNULL(expectedResult.expectedResult.conditionIndex, -1) = IFNULL(sObject.result.conditionIndex, -1)
      AND IFNULL(expectedResult.expectedResult.conditionText, '') = IFNULL(sObject.result.conditionText, '')
      AND IFNULL(expectedResult.expectedResult.runtimeError, '') = IFNULL(sObject.result.runtimeError, ''),
      "MATCH",
      "FAIL"
    ) as match,
    expectedResult.expectedResult.status as expectedStatus, sObject.result.status as actualStatus,
    expectedResult.expectedResult.conditionIndex as expectedConditionIndex, sObject.result.conditionIndex as actualConditionIndex,
    expectedResult.expectedResult.conditionText as expectedConditionText, sObject.result.conditionText as actualConditionText,
    expectedResult.expectedResult.runtimeError as expectedRuntimeError, sObject.result.runtimeError as actualRuntimeError
  FROM UNNEST(mock_ExpectedResult()) expectedResult
  LEFT JOIN (
      SELECT
          sObject.Id AS Id,
          sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
          process_CA10__CaAwsInstance__c(
              STRUCT(
                  sObject.Id AS Id,
                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10__CaAwsInstance__c()) AS sObject
  ) sObject ON sObject.Id = expectedResult.Id;
