### Question:
BpmnDeploymentListener implements ArtifactUrlTransformer { @Override public boolean canHandle(File artifact) { try { String artifactName = artifact.getName(); if (artifact.isFile() && (artifactName.endsWith(".xml") || artifactName.endsWith(".bpmn"))) { Document doc = parse(artifact); String name = doc.getDocumentElement().getLocalName(); String uri = doc.getDocumentElement().getNamespaceURI(); if ("definitions".equals(name) && "http: return true; } } } catch (Exception e) { LOGGER.log(Level.SEVERE, "Unable to parse deployed file " + artifact.getAbsolutePath(), e); } return false; }  @Override boolean canHandle(File artifact); @Override URL transform(URL artifact);  }### Answer:
@Test public void canHandleBpmnFile() { File file = new File("src/test/resources/testprocess.bpmn"); boolean canHandle = listener.canHandle(file); assertThat(canHandle, is(true)); }
@Test public void canHandleBpmnXmlFile() throws IOException { File bpmnXmlFile = new File("testprocess.bpmn20.xml"); FileUtils.copyFile(new File("src/test/resources/testprocess.bpmn"), bpmnXmlFile); bpmnXmlFile.deleteOnExit(); boolean canHandle = listener.canHandle(bpmnXmlFile); assertThat(canHandle, is(true)); }