@Before
    public void setUp() {
        inMemoryProfileService = new InMemoryProfileService<>(x -> new CommonProfile());
        inMemoryProfileService.setPasswordEncoder(PASSWORD_ENCODER);
        val password = PASSWORD_ENCODER.encode(PASSWORD);
        // insert sample data
        final Map<String, Object> properties1 = new HashMap<>();
        properties1.put(USERNAME, GOOD_USERNAME);
        properties1.put(FIRSTNAME, FIRSTNAME_VALUE);
        var profile = new CommonProfile();
        profile.build(IDPERSON1, properties1);
        inMemoryProfileService.create(profile, PASSWORD);
        // second person,
        final Map<String, Object> properties2 = new HashMap<>();
        properties2.put(USERNAME, MULTIPLE_USERNAME);
        profile = new CommonProfile();
        profile.build(IDPERSON2, properties2);
        inMemoryProfileService.create(profile, PASSWORD);
        final Map<String, Object> properties3 = new HashMap<>();
        properties3.put(USERNAME, MULTIPLE_USERNAME);
        properties3.put(PASSWORD, password);
        profile = new CommonProfile();
        profile.build(IDPERSON3, properties3);
        inMemoryProfileService.create(profile, PASSWORD);
    }
Tests the {@link InMemoryProfileService}.

@author Elie Roux
@since 2.1.0
pac4j-core/src/test/java/org/pac4j/core/profile/service/InMemoryProfileServiceTests.java