dominant = new Daemon();
recessive = new Daemon();
assertNull( generatorService.mergeDaemons( dominant, recessive ).getJvmSettings() );
JvmSettings settings = new JvmSettings();
dominant.setJvmSettings( settings );
assertEquals( settings, generatorService.mergeDaemons( dominant, recessive ).getJvmSettings() );
recessive.setJvmSettings( settings );
assertEquals( settings, generatorService.mergeDaemons( dominant, recessive ).getJvmSettings() );
dominant = new Daemon();
recessive = new Daemon();
dominant.setJvmSettings( new JvmSettings() );
recessive.setJvmSettings( new JvmSettings() );
dominant.getJvmSettings().addSystemProperty( "1" );
dominant.getJvmSettings().addSystemProperty( "2" );
JvmSettings mergedSettings = generatorService.mergeDaemons( dominant, recessive ).getJvmSettings();
assertEquals( 2, mergedSettings.getSystemProperties().size() );
dominant = new Daemon();
recessive = new Daemon();
dominant.setJvmSettings( new JvmSettings() );
recessive.setJvmSettings( new JvmSettings() );
dominant.getJvmSettings().addSystemProperty( "1" );
dominant.getJvmSettings().addSystemProperty( "2" );
dominant.getJvmSettings().addSystemProperty( "3" );
recessive.getJvmSettings().addSystemProperty( "a" );
recessive.getJvmSettings().addSystemProperty( "b" );
mergedSettings = generatorService.mergeDaemons( dominant, recessive ).getJvmSettings();
assertEquals( 3, mergedSettings.getSystemProperties().size() );
assertEquals( "1", mergedSettings.getSystemProperties().get( 0 ) );
assertEquals( "2", mergedSettings.getSystemProperties().get( 1 ) );
assertEquals( "3", mergedSettings.getSystemProperties().get( 2 ) );
}