### Question:
DDocFacade implements Serializable { public ContainerValidationResult validate() { logger.debug("Validating DDoc container ..."); List containerExceptions = this.ddoc.validate(true); containerExceptions.addAll(this.openContainerExceptions); DDocSignatureValidationResult result = new DDocSignatureValidationResult(this.ddoc.verify(true, true), containerExceptions, this.ddoc.getFormat()); result.print(this.configuration); return result; } DDocFacade(Configuration configuration);   DDocFacade(SignedDoc ddoc); String getSignatureProfile(); DigestAlgorithm getDigestAlgorithm(); List<DataFile> getDataFiles(); int countDataFiles(); void save(String path); void save(OutputStream out); List<Signature> getSignatures(); Signature getSignature(int index); int countSignatures(); Container.DocumentType getDocumentType(); ContainerValidationResult validate(); String getVersion(); String getFormat(); Configuration getConfiguration();  }### Answer:
@Test public void testRemoveDuplicatesExceptions() { DDocFacade facade = openDDocFacade("src/test/resources/prodFiles/invalid-containers/23060-1.ddoc"); ContainerValidationResult result = facade.validate(); Assert.assertEquals(1, result.getContainerErrors().size()); Assert.assertEquals(21, result.getContainerErrors().get(0).getErrorCode()); Assert.assertEquals("Invalid digest length", result.getContainerErrors().get(0).getMessage()); Assert.assertEquals(2, result.getErrors().size()); Assert.assertEquals(21, result.getErrors().get(0).getErrorCode()); Assert.assertEquals("Invalid digest length", result.getErrors().get(0).getMessage()); Assert.assertEquals(79, result.getErrors().get(1).getErrorCode()); Assert.assertEquals("Bad digest for SignedProperties: S0-SignedProperties", result.getErrors().get(1).getMessage()); }
@Test public void testValidateNoDuplicateExceptions() { DDocFacade facade = openDDocFacade("src/test/resources/prodFiles/invalid-containers/Belgia_kandeavaldus_LIV.ddoc"); ContainerValidationResult result = facade.validate(); Assert.assertEquals(3, result.getErrors().size()); }
@Test public void ddocStreamOpener() throws IOException { try (FileInputStream stream = new FileInputStream( new File("src/test/resources/testFiles/valid-containers/ddoc_wo_x509IssueName_xmlns.ddoc"))) { DDocContainer container = new DDocOpener().open(stream); Assert.assertTrue(container.validate().isValid()); } }