Grouping queries/filter

I am in the process of converting from Realm-Java to Realm-Kotlin, and I had a question about grouping queries/filter. Right now I have my realm-java code return a realm result that matches 2 possible sets of queries.

return list.where{ //group 1
                                ($0.quadrant == quadrant &&
                                 $0.due_date < Date() &&
                                 $0.due_date != nil &&
                                 $0.complete == false  &&
                                 $0.deleted == false)
                                
                                || //or
                                
// group 2
                                ($0.quadrant == "q2" &&
                                 $0.due_date < Date() &&
                                 $0.due_date != nil &&
                                 $0.complete == false &&
                                 $0.deleted == false)}

How would I write this in realm-kotlin so that it will return result that are either in group 1’s queries or group 2’s queries?

Thanks

I just realized I was working on the IOS version of my app as well and pasted in swift code instead of Kotlin. it should actually be:

return realm.where(Tasks::class.java)
  .equalTo("quadrant", quadrant)
  .lessThan("due_date", now).and()
  .isNotNull("due_date").and()
  .equalTo("complete", false).and()
  .equalTo("deleted", false)
    
  .or()
  
  .equalTo("quadrant", "q2")
  .lessThan("due_date", now).and()
  .isNotNull("due_date").and()
  .equalTo("complete", false).and()
  .equalTo("deleted", false)
    
  .sort(mySort.sort!!, mySort.direction!!)
  .findAllAsync()