### Question:
MavenCli { static ProjectActivation determineProjectActivation ( final CommandLine commandLine ) { final ProjectActivation projectActivation = new ProjectActivation(); if ( commandLine.hasOption( CLIManager.PROJECT_LIST ) ) { String[] projectOptionValues = commandLine.getOptionValues( CLIManager.PROJECT_LIST ); if ( projectOptionValues != null ) { for ( String projectOptionValue : projectOptionValues ) { StringTokenizer projectTokens = new StringTokenizer( projectOptionValue, "," ); while ( projectTokens.hasMoreTokens() ) { String projectAction = projectTokens.nextToken().trim(); if ( projectAction.startsWith( "-" ) || projectAction.startsWith( "!" ) ) { projectActivation.deactivate( projectAction.substring( 1 ) ); } else if ( projectAction.startsWith( "+" ) ) { projectActivation.activate( projectAction.substring( 1 ) ); } else { projectActivation.activate( projectAction ); } } } } } return projectActivation; } MavenCli();  MavenCli( ClassWorld classWorld ); static void main( String[] args ); static int main( String[] args, ClassWorld classWorld ); static int doMain( String[] args, ClassWorld classWorld ); int doMain( String[] args, String workingDirectory, PrintStream stdout, PrintStream stderr ); int doMain( CliRequest cliRequest ); static final String LOCAL_REPO_PROPERTY; static final String MULTIMODULE_PROJECT_DIRECTORY; static final String USER_HOME; static final File USER_MAVEN_CONFIGURATION_HOME; static final File DEFAULT_USER_TOOLCHAINS_FILE; static final File DEFAULT_GLOBAL_TOOLCHAINS_FILE; static final String STYLE_COLOR_PROPERTY; }### Answer:
@Test public void testDetermineProjectActivation() throws ParseException { MavenCli.ProjectActivation result; Options options = new Options(); options.addOption( Option.builder( CLIManager.PROJECT_LIST ).hasArg().build() ); result = determineProjectActivation( new GnuParser().parse( options, new String[0] ) ); assertThat( result.activeProjects, is( nullValue() ) ); assertThat( result.inactiveProjects, is( nullValue() ) ); result = determineProjectActivation( new GnuParser().parse( options, new String[]{ "-pl", "test1,+test2" } ) ); assertThat( result.activeProjects.size(), is( 2 ) ); assertThat( result.activeProjects, contains( "test1", "test2" ) ); result = determineProjectActivation( new GnuParser().parse( options, new String[]{ "-pl", "!test1,-test2" } ) ); assertThat( result.inactiveProjects.size(), is( 2 ) ); assertThat( result.inactiveProjects, contains( "test1", "test2" ) ); result = determineProjectActivation( new GnuParser().parse( options, new String[]{ "-pl" ,"-test1,+test2" } ) ); assertThat( result.activeProjects.size(), is( 1 ) ); assertThat( result.activeProjects, contains( "test2" ) ); assertThat( result.inactiveProjects.size(), is( 1 ) ); assertThat( result.inactiveProjects, contains( "test1" ) ); }