### Question:
DefaultProfileService implements ProfileService { public Profile addProfile( Profile profile ) throws ProfileException, AlreadyExistsProfileException { if ( alreadyExistsProfileName( profile ) ) { throw new AlreadyExistsProfileException( "profile with name " + profile.getName() + " already exists" ); } profile.setBuilder( null ); profile.setJdk( null ); profile.setEnvironmentVariables( null ); return profileDao.addProfile( profile ); }  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 testAddProfile() throws Exception { Profile defaultProfile = new Profile(); String name = "default profile"; defaultProfile.setName( name ); Profile getted = getProfileService().addProfile( defaultProfile ); assertNotNull( getProfileService().getProfile( getted.getId() ) ); assertEquals( name, getProfileService().getProfile( getted.getId() ).getName() ); assertEquals( 3, getProfileService().getAllProfiles().size() ); }