### Question:
DefaultProfileService implements ProfileService { public void addEnvVarInProfile( Profile profile, Installation envVar ) throws ProfileException { Profile stored = getProfile( profile.getId() ); stored.addEnvironmentVariable( envVar ); try { profileDao.updateProfile( stored ); } catch ( ContinuumStoreException e ) { throw new ProfileException( e.getMessage(), e ); } }  void updateProfile( Profile profile ); void updateProfileCheckDuplicateName( Profile profile, boolean checkDuplicateName ); Profile addProfile( Profile profile ); void deleteProfile( int profileId ); List<Profile> getAllProfiles(); Profile getProfile( int profileId ); void setBuilderInProfile( Profile profile, Installation builder ); void setJdkInProfile( Profile profile, Installation jdk ); void addEnvVarInProfile( Profile profile, Installation envVar ); void addInstallationInProfile( Profile profile, Installation installation ); void removeInstallationFromProfile( Profile profile, Installation installation ); Profile getProfileWithName( String profileName ); boolean alreadyExistsProfileName( Profile profile );  }### Answer:
@Test public void testAddEnvVarInProfile() throws Exception { Profile profile = getProfileService().getProfile( jdk1mvn205.getId() ); getProfileService().setBuilderInProfile( profile, mvn206 ); getProfileService().addEnvVarInProfile( profile, mvnOpts1 ); profile = getProfileService().getProfile( jdk1mvn205.getId() ); assertFalse( profile.getEnvironmentVariables().isEmpty() ); assertEquals( 1, profile.getEnvironmentVariables().size() ); }