### Question:
PersistenceUtils { public static List<String> getNames(final String fileName) { try (final InputStream in = PersistenceUtils.class.getClassLoader().getResourceAsStream(fileName)) { if (in == null) { return Collections.emptyList(); } return scanPersistenceXml(in); } catch (final Exception ex) { LOG.warn("Error reading persistence.xml: {}", ex.getMessage(), ex); return Collections.emptyList(); } } PersistenceUtils(); static List<String> getNames(final String fileName);  }### Answer:
@Test public void testNotFound() { assertEquals(Collections.emptyList(), PersistenceUtils.getNames("not-found.xml")); }
@Test public void testNotXml() { assertEquals(Collections.emptyList(), PersistenceUtils.getNames("not-xml.txt")); }
@Test public void testOne() { assertEquals(Collections.singletonList("testdb"), PersistenceUtils.getNames("test-persistence1.xml")); }
@Test public void testMultiple() { assertEquals(Arrays.asList("test1", "test2"), PersistenceUtils.getNames("test-persistence2.xml")); }