GuessingCompactFactory extends AbstractDocumentFactory { @Override public boolean isValid(Document doc) { Optional<Node> dataSetNode = lookupDataSetNode(doc); return dataSetNode.isPresent() && !hasKeyFamilyRef(dataSetNode.get()); }  @Override String getName(); @Override boolean isValid(Document doc); @Override SdmxSource create(Document doc);  }
@Test public void testIsValid() throws Exception { GuessingCompactFactory factory = new GuessingCompactFactory(); assertFalse(factory.isValid(load("/sdmx-generic-sample.xml"))); assertTrue(factory.isValid(load("/sdmx-compact-sample.xml"))); }