@Override
    public Set<ConstraintCheckResult> checkConstraints(Collection<Constraint> requestedConstraints) {
        final ImmutableSet.Builder<ConstraintCheckResult> fulfilledConstraints = ImmutableSet.builder();
        for (Constraint constraint : requestedConstraints) {
            if (constraint instanceof PluginVersionConstraint) {
                final PluginVersionConstraint versionConstraint = (PluginVersionConstraint) constraint;
                final Requirement requiredVersion = versionConstraint.version();

                boolean result = false;
                for (Semver pluginVersion : pluginVersions) {
                    if (requiredVersion.isSatisfiedBy(pluginVersion)) {
                        result = true;
                    }
                }
                ConstraintCheckResult constraintCheckResult = ConstraintCheckResult.create(versionConstraint, result);
                fulfilledConstraints.add(constraintCheckResult);
            }
        }
        return fulfilledConstraints.build();
    }
@Test
    public void checkSnapshotVersionOfPlugin() {
        // create a plugin metadata with -SNAPSHOT version
        final TestPluginMetaData pluginMetaData = new TestPluginMetaData(Version.from(4, 4, 0, "SNAPSHOT"));

        // require a version the same number, but ignore the -SNAPSHOT suffix
        final PluginVersionConstraint pluginVersionConstraint = PluginVersionConstraint.builder()
                .pluginId("unique-id")
                .version(">=4.4.0")
                .build();

        final PluginVersionConstraintChecker constraintChecker = new PluginVersionConstraintChecker(Collections.singleton(pluginMetaData));
        final ImmutableSet<Constraint> requiredConstraints = ImmutableSet.of(pluginVersionConstraint);

        // let the checker compute results
        final Set<ConstraintCheckResult> results = constraintChecker.checkConstraints(requiredConstraints);

        // there should be one element that's fulfilled => -SNAPSHOT version is accepted
        assertThat(results).hasOnlyOneElementSatisfying(r -> assertThat(r.fulfilled()).isTrue());
    }