class GenericDocFactory extends AbstractDocumentFactory {

    @Override
    public boolean isValid(Document doc) {
        Optional<Node> dataSetNode = lookupDataSetNode(doc);
        return dataSetNode.isPresent() && hasKeyFamilyRef(dataSetNode.get());
    }

}