### Question:
ProcessProfile extends BaseProfile<ProcessProfile, ProcessProvider> { @Deprecated public static Collection<? extends ProcessProfile> 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)); } ProcessProfile(
            String name,
            Class<? extends ProcessProvider> providerClass,
            ProfileContext context,
            Map<String, String> configuration); String getName(); @Override Class<? extends ProcessProvider> getProviderClass(); @Override ProfileContext getContext(); Map<String, String> getConfiguration(); @Deprecated static Collection<? extends ProcessProfile> loadFrom(Properties properties, ClassLoader loader); static Collection<? extends ProcessProfile> loadFrom(Properties properties, ProfileContext context); void storeTo(Properties properties); static void removeCorrespondingKeys(Properties properties); static final Pattern NAME_PATTERN; static final String KEY_PREFIX; }### Answer:
@Test public void loadFrom() { Properties p = new Properties(); p.setProperty(ProcessProfile.KEY_PREFIX + "testing", BasicProcessProvider.class.getName()); Collection<? extends ProcessProfile> profiles = ProcessProfile.loadFrom(p, ProfileContext.system(getClass().getClassLoader())); assertThat(profiles.size(), is(1)); ProcessProfile p1 = find(profiles, "testing"); assertThat(p1.getName(), is("testing")); assertThat(p1.getProviderClass(), is((Object) BasicProcessProvider.class)); assertThat(p1.getConfiguration().size(), is(0)); }
@Test(expected = IllegalArgumentException.class) public void loadFrom_missing_provider() { Properties p = new Properties(); p.setProperty(ProcessProfile.KEY_PREFIX + "testing" + BaseProfile.QUALIFIER + "conf", "aaa"); ProcessProfile.loadFrom(p, ProfileContext.system(getClass().getClassLoader())); }