### Question:
SynchXmlDocumentTranslator implements Processor, ApplicationContextAware { String graphName(final JobInstance instance) { return isNotNullAndNotEmpty(instance.getGraphName()) ? instance.getGraphName() : instance.getNamespace(); }  @Override final void process(final Exchange exchange); @Override void setApplicationContext(final ApplicationContext context);  }### Answer:
@Test public void graphNameNull() { final String [] invalidGraphNames = {null, " ", "","\t"}; final String namespace = randomString(); final JobInstance instance = new JobInstance(); instance.setNamespace(namespace); for (final String invalidGraphName : invalidGraphNames) { instance.setGraphName(invalidGraphName); assertEquals(namespace, cut.graphName(instance)); } }
@Test public void graphNameNotNull() { final String graphName = randomString() + "GN"; final String namespace = randomString() + "NS"; final JobInstance instance = new JobInstance(); instance.setNamespace(namespace); instance.setNamespace(graphName); assertEquals(graphName, cut.graphName(instance)); }