From d82cb3e58aeb44da54aafb12276012eeb06a419c Mon Sep 17 00:00:00 2001 From: Takashi Kinjo Date: Wed, 16 Aug 2017 20:12:04 +0900 Subject: [PATCH] Rename findAny to findFirst --- src/ii_collections/n15AllAnyAndOtherPredicates.kt | 4 ++-- test/ii_collections/N15AllAnyAndOtherPredicatesKtTest.kt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ii_collections/n15AllAnyAndOtherPredicates.kt b/src/ii_collections/n15AllAnyAndOtherPredicates.kt index 788d64bfa..15b417317 100644 --- a/src/ii_collections/n15AllAnyAndOtherPredicates.kt +++ b/src/ii_collections/n15AllAnyAndOtherPredicates.kt @@ -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() } diff --git a/test/ii_collections/N15AllAnyAndOtherPredicatesKtTest.kt b/test/ii_collections/N15AllAnyAndOtherPredicatesKtTest.kt index 440ca5acb..66762b54c 100644 --- a/test/ii_collections/N15AllAnyAndOtherPredicatesKtTest.kt +++ b/test/ii_collections/N15AllAnyAndOtherPredicatesKtTest.kt @@ -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"))) } }