class LicenseHandler implements LicenseMatcher {

    @Override
    public Set<DbLicense> getMatchingLicenses(String licenseString) {
        final List<DbLicense> allLicenses = repoHandler.getAllLicenses();
        return allLicenses
                .stream()
                .filter(license ->
                        licenseString.equalsIgnoreCase(license.getName()) ||
                                (
                                        !license.getRegexp().isEmpty() &&
                                                licenseString.matches(String.format("(?i:%s)", license.getRegexp()))
                                )
                )
                .collect(Collectors.toSet());
    }

    public  LicenseHandler(final RepositoryHandler repoHandler);

}