// Path: enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java
// public interface EnforcerRuleHelper
//     extends ExpressionEvaluator
// {
// 
//     /**
//      * Gets the log.
//      *
//      * @return the log
//      */
//     @Nonnull
//     Log getLog ();
// 
//     /**
//      * Gets the component.
//      *
//      * @param clazz the clazz
//      *
//      * @return the component
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     @Nonnull
//     <T> T getComponent ( Class<T> clazz )
//         throws ComponentLookupException;
// 
//     /**
//      * Gets the component.
//      *
//      * @param componentKey the component key
//      *
//      * @return the component
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     @Nonnull
//     Object getComponent ( String componentKey )
//         throws ComponentLookupException;
// 
//     /**
//      * Gets the component.
//      *
//      * @param role the role
//      * @param roleHint the role hint
//      *
//      * @return the component
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     Object getComponent ( String role, String roleHint )
//         throws ComponentLookupException;
// 
//     /**
//      * Gets the component.
//      *
//      * @param clazz the clazz
//      * @param roleHint the role hint
//      *
//      * @return the component
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     <T> T getComponent ( Class<T> clazz, String roleHint )
//         throws ComponentLookupException;
//     
//     /**
//      * Gets the component map.
//      *
//      * @param role the role
//      *
//      * @return the component map
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     Map<String, ?> getComponentMap ( String role )
//         throws ComponentLookupException;
// 
//     /**
//      * Gets the component list.
//      *
//      * @param role the role
//      *
//      * @return the component list
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     List<?> getComponentList ( String role )
//         throws ComponentLookupException;
// 
//     /**
//      * Gets the container.
//      *
//      * @return the container
//      */
//     PlexusContainer getContainer();
// }


import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.apache.commons.lang3.SystemUtils;
import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
        // test for non-standard versions
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1-5-0-11" ) ).isEqualTo( "1.5.0-11" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1-_5-_0-_11" ) ).isEqualTo( "1.5.0-11" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1_5_0_11" ) ).isEqualTo( "1.5.0-11" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.0-07" ) ).isEqualTo( "1.5.0-7" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.0-b7" ) ).isEqualTo( "1.5.0-7" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.0-;7" ) ).isEqualTo( "1.5.0-7" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.6.0-dp" ) ).isEqualTo( "1.6.0" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.6.0-dp2" ) ).isEqualTo( "1.6.0-2" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.8.0_73" ) ).isEqualTo( "1.8.0-73" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "9" ) ).isEqualTo( "9" );

        assertThat( RequireJavaVersion.normalizeJDKVersion( "17" ) ).isEqualTo( "17" );

    }

    /**
     * Test rule.
     *
     * @throws EnforcerRuleException the enforcer rule exception
     */
    @Test
    public void settingsTheJavaVersionAsNormalizedVersionShouldNotFail()
        throws EnforcerRuleException
    {
        String normalizedJDKVersion = RequireJavaVersion.normalizeJDKVersion( SystemUtils.JAVA_VERSION );

        RequireJavaVersion rule = new RequireJavaVersion();
        rule.setVersion( normalizedJDKVersion );

// Path: enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java
// public interface EnforcerRuleHelper
//     extends ExpressionEvaluator
// {
// 
//     /**
//      * Gets the log.
//      *
//      * @return the log
//      */
//     @Nonnull
//     Log getLog ();
// 
//     /**
//      * Gets the component.
//      *
//      * @param clazz the clazz
//      *
//      * @return the component
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     @Nonnull
//     <T> T getComponent ( Class<T> clazz )
//         throws ComponentLookupException;
// 
//     /**
//      * Gets the component.
//      *
//      * @param componentKey the component key
//      *
//      * @return the component
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     @Nonnull
//     Object getComponent ( String componentKey )
//         throws ComponentLookupException;
// 
//     /**
//      * Gets the component.
//      *
//      * @param role the role
//      * @param roleHint the role hint
//      *
//      * @return the component
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     Object getComponent ( String role, String roleHint )
//         throws ComponentLookupException;
// 
//     /**
//      * Gets the component.
//      *
//      * @param clazz the clazz
//      * @param roleHint the role hint
//      *
//      * @return the component
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     <T> T getComponent ( Class<T> clazz, String roleHint )
//         throws ComponentLookupException;
//     
//     /**
//      * Gets the component map.
//      *
//      * @param role the role
//      *
//      * @return the component map
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     Map<String, ?> getComponentMap ( String role )
//         throws ComponentLookupException;
// 
//     /**
//      * Gets the component list.
//      *
//      * @param role the role
//      *
//      * @return the component list
//      *
//      * @throws ComponentLookupException the component lookup exception
//      */
//     List<?> getComponentList ( String role )
//         throws ComponentLookupException;
// 
//     /**
//      * Gets the container.
//      *
//      * @return the container
//      */
//     PlexusContainer getContainer();
// }


// Path: enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVersion.java
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.apache.commons.lang3.SystemUtils;
import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

        // test for non-standard versions
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1-5-0-11" ) ).isEqualTo( "1.5.0-11" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1-_5-_0-_11" ) ).isEqualTo( "1.5.0-11" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1_5_0_11" ) ).isEqualTo( "1.5.0-11" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.0-07" ) ).isEqualTo( "1.5.0-7" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.0-b7" ) ).isEqualTo( "1.5.0-7" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.5.0-;7" ) ).isEqualTo( "1.5.0-7" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.6.0-dp" ) ).isEqualTo( "1.6.0" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.6.0-dp2" ) ).isEqualTo( "1.6.0-2" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "1.8.0_73" ) ).isEqualTo( "1.8.0-73" );
        assertThat( RequireJavaVersion.normalizeJDKVersion( "9" ) ).isEqualTo( "9" );

        assertThat( RequireJavaVersion.normalizeJDKVersion( "17" ) ).isEqualTo( "17" );

    }

    /**
     * Test rule.
     *
     * @throws EnforcerRuleException the enforcer rule exception
     */
    @Test
    public void settingsTheJavaVersionAsNormalizedVersionShouldNotFail()
        throws EnforcerRuleException
    {
        String normalizedJDKVersion = RequireJavaVersion.normalizeJDKVersion( SystemUtils.JAVA_VERSION );

        RequireJavaVersion rule = new RequireJavaVersion();
        rule.setVersion( normalizedJDKVersion );

        EnforcerRuleHelper helper = EnforcerTestUtils.getHelper();