public PackageDefinition findPackageDefinitionWith(String packageId) {
        for (PackageRepository packageRepository : this) {
            for (PackageDefinition packageDefinition : packageRepository.getPackages()) {
                if (packageDefinition.getId().equals(packageId)) {
                    return packageDefinition;
                }
            }
        }
        return null;
    }
@Test
    void shouldGetPackageDefinitionForGivenPackageId() throws Exception {
        PackageRepository repo1 = PackageRepositoryMother.create("repo-id1", "repo1", "plugin-id", "1.0", null);
        PackageDefinition packageDefinitionOne = PackageDefinitionMother.create("pid1", repo1);
        PackageDefinition packageDefinitionTwo = PackageDefinitionMother.create("pid2", repo1);
        repo1.getPackages().addAll(List.of(packageDefinitionOne, packageDefinitionTwo));

        PackageRepository repo2 = PackageRepositoryMother.create("repo-id2", "repo2", "plugin-id", "1.0", null);
        PackageDefinition packageDefinitionThree = PackageDefinitionMother.create("pid3", repo2);
        PackageDefinition packageDefinitionFour = PackageDefinitionMother.create("pid4", repo2);
        repo2.getPackages().addAll(List.of(packageDefinitionThree, packageDefinitionFour));


        PackageRepositories packageRepositories = new PackageRepositories(repo1, repo2);
        assertThat(packageRepositories.findPackageDefinitionWith("pid3")).isEqualTo(packageDefinitionThree);
        assertThat(packageRepositories.findPackageDefinitionWith("pid5")).isNull();
    }