### Question:
ProfilesConf implements PluginConf { @Override public String getProtocol(String profileName) { return getProfile(profileName).getProtocol(); } private  ProfilesConf();   ProfilesConf(String internalProfilesFilename, String externalProfilesFilename); static ProfilesConf getInstance(); @Override Map<String, String> getOptionMappings(String profileName); @Override Map<String, String> getPlugins(String profileName); @Override String getProtocol(String profileName); @Override String getHandler(String profileName);  }### Answer:
@Test public void testUndefinedProfileWhenGettingProtocol() { expectedException.expect(ProfileConfException.class); expectedException.expectMessage("UndefinedProfile is not defined in profile/undefinedProfile/pxf-profiles.xml"); ProfilesConf profilesConf = getProfilesConf("undefinedProfile"); assertNull(profilesConf.getProtocol("UndefinedProfile")); }
@Test public void testGetProtocol() { ProfilesConf profilesConf = getProfilesConf("testGetProtocol"); assertEquals("bar", profilesConf.getProtocol("foo")); }
@Test public void testGetMissingProtocol() { ProfilesConf profilesConf = getProfilesConf("testGetProtocol"); assertNull(profilesConf.getProtocol("bar")); }