Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
Rename findAny to findFirst
Browse files Browse the repository at this point in the history
  • Loading branch information
Takashi Kinjo committed Aug 16, 2017
1 parent 3887c0d commit d82cb3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ii_collections/n15AllAnyAndOtherPredicates.kt
Expand Up @@ -33,7 +33,7 @@ fun Shop.countCustomersFrom(city: City): Int {
todoCollectionTask()
}

fun Shop.findAnyCustomerFrom(city: City): Customer? {
// Return a customer who lives in the given city, or null if there is none
fun Shop.findFirstCustomerFrom(city: City): Customer? {
// Return the first customer who lives in the given city, or null if there is none
todoCollectionTask()
}
6 changes: 3 additions & 3 deletions test/ii_collections/N15AllAnyAndOtherPredicatesKtTest.kt
Expand Up @@ -22,8 +22,8 @@ class N15AllAnyAndOtherPredicatesKtTest {
assertEquals(2, shop.countCustomersFrom(Canberra))
}

@Test fun testAnyCustomerFromCity() {
assertEquals(customers[lucas], shop.findAnyCustomerFrom(Canberra))
assertEquals(null, shop.findAnyCustomerFrom(City("Chicago")))
@Test fun testFirstCustomerFromCity() {
assertEquals(customers[lucas], shop.findFirstCustomerFrom(Canberra))
assertEquals(null, shop.findFirstCustomerFrom(City("Chicago")))
}
}

0 comments on commit d82cb3e

Please sign in to comment.