### Question:
SessionProfile extends BaseProfile<SessionProfile, SessionProvider> { @Deprecated public static SessionProfile loadFrom(Properties properties, ClassLoader loader) { if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } if (loader == null) { throw new IllegalArgumentException("loader must not be null"); } return loadFrom(properties, ProfileContext.system(loader)); } SessionProfile(
            Class<? extends SessionProvider> providerClass,
            ProfileContext context,
            Map<String, String> configuration); @Override Class<? extends SessionProvider> getProviderClass(); @Override ProfileContext getContext(); Map<String, String> getConfiguration(); @Deprecated static SessionProfile loadFrom(Properties properties, ClassLoader loader); static SessionProfile loadFrom(Properties properties, ProfileContext context); void storeTo(Properties properties); static void removeCorrespondingKeys(Properties properties); static final String KEY_PROVIDER; static final String KEY_PREFIX; }### Answer:
@Test public void loadFrom() { Properties p = new Properties(); p.setProperty(SessionProfile.KEY_PROVIDER, FileSessionProvider.class.getName()); SessionProfile profile = SessionProfile.loadFrom(p, ProfileContext.system(getClass().getClassLoader())); assertThat(profile.getProviderClass(), is((Object) FileSessionProvider.class)); assertThat(profile.getConfiguration().size(), is(0)); }
@Test public void createProvider() throws Exception { File path = folder.newFolder("session"); Assume.assumeTrue(path.delete()); Properties p = new Properties(); p.setProperty(SessionProfile.KEY_PROVIDER, FileSessionProvider.class.getName()); p.setProperty(SessionProfile.KEY_PREFIX + FileSessionProvider.KEY_DIRECTORY, path.getPath()); SessionProfile profile = SessionProfile.loadFrom(p, ProfileContext.system(getClass().getClassLoader())); SessionProvider provider = profile.createProvider(); try (SessionMirror session = provider.create("hello")) { } assertThat(path.isDirectory(), is(true)); }