public PackageRepository findPackageRepositoryHaving(String packageId) {
        for (PackageRepository packageRepository : this) {
            for (PackageDefinition packageDefinition : packageRepository.getPackages()) {
                if (packageDefinition.getId().equals(packageId)) {
                    return packageRepository;
                }
            }
        }
        return null;
    }
@Test
    void shouldReturnNullWhenRepositoryForGivenPackageNotFound() throws Exception {
        PackageRepositories packageRepositories = new PackageRepositories();
        assertThat(packageRepositories.findPackageRepositoryHaving("invalid")).isNull();
    }