### Question:
DefaultInstallationService implements InstallationService, Initializable { public Installation add( Installation installation ) throws InstallationException, AlreadyExistsInstallationException { try { return this.add( installation, false ); } catch ( AlreadyExistsProfileException e ) { throw new InstallationException( e.getMessage(), e ); } }  void initialize(); Installation add( Installation installation ); Installation add( Installation installation, boolean automaticProfile ); void delete( Installation installation ); @SuppressWarnings( "unchecked" ) List<Installation> getAllInstallations(); Installation getInstallation( int installationId ); Installation getInstallation( String installationName ); void update( Installation installation ); ExecutorConfigurator getExecutorConfigurator( String type ); String getEnvVar( String type ); List<String> getDefaultJavaVersionInfo(); List<String> getJavaVersionInfo( Installation installation ); List<String> getExecutorVersionInfo( String path, ExecutorConfigurator executorConfigurator,
                                                Profile profile );  }### Answer:
@Test public void testAddInstallationAutomaticProfile() throws Exception { Installation installation = new Installation(); installation.setType( InstallationService.JDK_TYPE ); installation.setName( "automaticJdk" ); installation.setVarName( "automaticvarName" ); installation.setVarValue( "automaticvarValue" ); getInstallationService().add( installation, true ); ProfileService profileService = (ProfileService) lookup( ProfileService.ROLE, "default" ); List<Profile> profiles = profileService.getAllProfiles(); assertEquals( 1, profiles.size() ); Profile profile = profiles.get( 0 ); assertEquals( "automaticJdk", profile.getName() ); Installation jdk = profile.getJdk(); assertNotNull( jdk ); assertEquals( "automaticJdk", jdk.getName() ); }