### Question:
SharedModulesParser { public Set<String> getSharedModules() { Set<String> sharedModules = ImmutableSet.of(); try { sharedModules = parseXMLFile(); } catch (final Exception e) { logger.warn("Problem while getting the XML file with the Python modules to be shared.", e); } return sharedModules; } SharedModulesParser(final String xmlFileName);  SharedModulesParser(); Set<String> getSharedModules();  }### Answer:
@Test public void validXMLFileTest() { final Set<String> sharedPythonPackages = new SharedModulesParser().getSharedModules(); assertThat(sharedPythonPackages) .as("Set of shared modules.") .hasSize(2) .contains("my_package_1", "my_package_2"); }
@Test public void emptyFileTest() { final File file = Files.newTemporaryFile(); file.deleteOnExit(); final SharedModulesParser sharedModulesParser = new SharedModulesParser(file.getAbsolutePath()); assertThat(sharedModulesParser.getSharedModules()) .as("Set of shared modules.") .hasSize(0); }
@Test public void nonExistingFileTest() { final SharedModulesParser sharedModulesParser = new SharedModulesParser("non_existing_file"); assertThat(sharedModulesParser.getSharedModules()) .as("Set of shared modules.") .hasSize(0); }