title: Realm: Comparing List of primitive types, e.g.: List<String>
body: <h2>What is the intended way to compare Realm's list of strings?</h2>
  
  <p>I'm trying to compare 2 lists of strings in Realm, as follows:</p>
  
  <pre><code>func testRealmListOfStrings() {
  
      let strings = ["a", "b", "c"]
      let list1 = List&lt;String&gt;()
      list1.append(objectsIn: strings)
  
      let list2 = List&lt;String&gt;()
      list2.append(objectsIn: strings)
  
      // 1. ok
      XCTAssertTrue(list1 !== list2, "instances should not be identical")
  
      // 2. fails
      XCTAssertTrue(list1 == list2, "instances should be equal by `==` operator")
  
      // 3. fails
      XCTAssertTrue(list1.isEqual(list2), "instances should be equal by `isEqual` method")
  
      // 4. ok
      XCTAssertTrue(Array(list1) == Array(list2), "instances converted to Swift.Array should be equal")
  }
  </code></pre>
  
  <p>However, this does not work as expected. The test fails on <code>2.</code> and <code>3.</code>.</p>
  
  <p>According to <a href="https://stackoverflow.com/a/38877533/1161723">how Realm object's Equatable is implemented</a> this should work as expected although, the answer does not specify how exactly it's implemented in List.</p>