ProfileName { public static String getNameForEnvironment(TargetEnvironment env, List<ProfileName> nameMap, String defaultName) { if (nameMap != null) { for (ProfileName profileWithEnvironment : nameMap) { if (env.match(profileWithEnvironment.getOs(), profileWithEnvironment.getWs(), profileWithEnvironment.getArch())) { return profileWithEnvironment.getName(); } } } return defaultName; } ProfileName();  ProfileName(String name);  ProfileName(String name, String os, String ws, String arch); String getName(); String getArch(); String getOs(); String getWs(); static String getNameForEnvironment(TargetEnvironment env, List<ProfileName> nameMap, String defaultName);  }
@Test public void testNoEnvironmentSpecificNames() throws Exception { assertThat(DEFAULT_NAME, is(ProfileName.getNameForEnvironment(LINUX_GTK_X86_64, null, DEFAULT_NAME))); }
@Test public void testNoMatch() { List<ProfileName> configuration = Arrays.asList(SPECIFIC_LINUX_CONFIG); String name = ProfileName.getNameForEnvironment(WIN32_WIN32_X86_64, configuration, DEFAULT_NAME); assertEquals(DEFAULT_NAME, name); }