### Question:
PostmanScenarioIndexerService { String extractCountryCodes(String[] path) { if (path != null && path.length != 0) { String rootFolder = path[0]; if (StringUtils.isNotEmpty(rootFolder)) { final Set<String> countryCodes = Arrays.stream(rootFolder.split("\\+")) .map(String::trim) .filter(StringUtils::isNotEmpty) .collect(Collectors.toCollection(TreeSet::new)); if (countryCodes.isEmpty() || countryCodes.contains(Tag.COUNTRY_ALL)) { countryCodes.clear(); countryCodes.add(Tag.COUNTRY_ALL); } return String.join(Scenario.COUNTRY_CODES_SEPARATOR, countryCodes); } } return Tag.COUNTRY_ALL; }  List<Scenario> extractScenarios(Source source, File zipFile);  }### Answer:
@Test public void extractCountryCodes_should_return_all_when_root_folder_is_all() { assertThat(cut.extractCountryCodes(new String[] { "all" })).isEqualTo("all"); }
@Test public void extractCountryCodes_should_return_all_when_no_folder_provided() { assertThat(cut.extractCountryCodes(null)).isEqualTo("all"); assertThat(cut.extractCountryCodes(new String[] {})).isEqualTo("all"); assertThat(cut.extractCountryCodes(new String[] { null })).isEqualTo("all"); assertThat(cut.extractCountryCodes(new String[] { "" })).isEqualTo("all"); assertThat(cut.extractCountryCodes(new String[] { "+" })).isEqualTo("all"); assertThat(cut.extractCountryCodes(new String[] { "++" })).isEqualTo("all"); assertThat(cut.extractCountryCodes(new String[] { "+ +" })).isEqualTo("all"); }
@Test public void extractCountryCodes_should_return_country_codes_if_at_least_one_is_present() { assertThat(cut.extractCountryCodes(new String[] { "a" })).isEqualTo("a"); assertThat(cut.extractCountryCodes(new String[] { "fr+us" })).isEqualTo("fr,us"); }
@Test public void extractCountryCodes_should_return_sorted_country_codes() { assertThat(cut.extractCountryCodes(new String[] { "f+a+c+edd+b+d" })).isEqualTo("a,b,c,d,edd,f"); }
@Test public void extractCountryCodes_should_return_all_if_at_least_one_is_all() { assertThat(cut.extractCountryCodes(new String[] { "fr+all+us" })).isEqualTo("all"); assertThat(cut.extractCountryCodes(new String[] { "us+all" })).isEqualTo("all"); }
@Test public void extractCountryCodes_should_remove_empty_country_codes() { assertThat(cut.extractCountryCodes(new String[] { "fr++us+" })).isEqualTo("fr,us"); }
@Test public void extractCountryCodes_should_ignore_sub_folders() { assertThat(cut.extractCountryCodes(new String[] { "fr+us", "fr+de" })).isEqualTo("fr,us"); }
@Test public void extractCountryCodes_should_trim_codes() { assertThat(cut.extractCountryCodes(new String[] { " fr + us " })).isEqualTo("fr,us"); }