### Question:
EnvironmentViewService { public Set<EnvironmentView> findByResourceCrnsInAccount(Set<String> resourceCrns, @NotNull String accountid) { return CollectionUtils.isEmpty(resourceCrns) ? new HashSet<>() : environmentViewRepository .findAllByResourceCrnInAndAccountIdAndArchivedIsFalse(resourceCrns, accountid); } EnvironmentViewService(EnvironmentViewRepository environmentViewRepository, ConversionService conversionService); Set<EnvironmentView> findByNamesInAccount(Set<String> names, @NotNull String accountid); Set<EnvironmentView> findByResourceCrnsInAccount(Set<String> resourceCrns, @NotNull String accountid); Set<SimpleEnvironmentResponse> listByAccountId(String accountId); Set<EnvironmentView> findAllByAccountId(String accountId); Set<EnvironmentView> findAllByCredentialId(Long credentialId); Long getIdByName(String environmentName, String accountId); Long getIdByCrn(String crn, String accountId);  }### Answer:
@Test void findByResourceCrnsInAccount() { Set<EnvironmentView> queryResult = Set.of(); when(environmentViewRepository .findAllByResourceCrnInAndAccountIdAndArchivedIsFalse(anyCollection(), eq(ACCOUNT_ID))) .thenReturn(queryResult); assertEquals(queryResult, environmentViewServiceUnderTest.findByResourceCrnsInAccount(Set.of("crn1", "crn2"), ACCOUNT_ID), "findByResourceCrnsInAccount expected to give back the same result as repository mock (findAllByResourceCrnInAndAccountId)"); }
@Test void findByResourceCrnsInAccountEmptyNameList() { assertEquals(Set.of(), environmentViewServiceUnderTest.findByResourceCrnsInAccount(Set.of(), ACCOUNT_ID), "without name list the result should be empty"); }