### Question:
PersistenceProductDerivation extends AbstractProductDerivation implements OpenJPAProductDerivation { @Override public List getAnchorsInResource(String resource) throws Exception { ConfigurationParser parser = new ConfigurationParser(null); try { List results = new ArrayList(); ClassLoader loader = AccessController.doPrivileged( J2DoPrivHelper.getContextClassLoaderAction()); List<URL> urls = getResourceURLs(resource, loader); if (urls != null) { for (URL url : urls) { parser.parse(url); results.addAll(getUnitNames(parser)); } } return results; } catch (IOException e) { return null; } } PersistenceProductDerivation(); @Override void putBrokerFactoryAliases(Map<String, String> m); @Override int getType(); @Override String getConfigurationPrefix(); @Override Set<String> getSupportedQueryHints(); @Override void validate(); @Override boolean beforeConfigurationLoad(Configuration c); @Override boolean afterSpecificationSet(Configuration c); ConfigurationProvider load(PersistenceUnitInfo pinfo, Map m); ConfigurationProvider load(String rsrc, String name, Map m); @Override ConfigurationProvider load(String rsrc, String anchor,
        ClassLoader loader); @Override ConfigurationProvider load(File file, String anchor); @Override String getDefaultResourceLocation(); @Override List<String> getAnchorsInFile(File file); @Override List getAnchorsInResource(String resource); @Override ConfigurationProvider loadGlobals(ClassLoader loader); @Override ConfigurationProvider loadDefaults(ClassLoader loader); boolean checkPuNameCollisions(Log logger,String puName); static final Specification SPEC_JPA; static final Specification ALIAS_EJB; static final String RSRC_GLOBAL; static final String RSRC_DEFAULT; static final BigDecimal VERSION_1_0; static final String PREFIX; }### Answer:
@Test public void testGetAnchorsInResource()throws Exception { List<String> expectedPUs = Arrays.asList( new String[]{"pu_1","pu_2","pu_3"}); PersistenceProductDerivation ppd = new PersistenceProductDerivation(); List<String> actual = ppd.getAnchorsInResource("META-INF/persistence.xml"); assertTrue(actual.containsAll(expectedPUs)); assertFalse(actual.contains("bad_provider")); }