### Question:
SignatureBuilder implements Serializable { public abstract Signature openAdESSignature(byte[] signatureDocument);  static SignatureBuilder aSignature(Container container); static void setSignatureBuilderForContainerType(
      String containerType,
      Class<T> signatureBuilderClass); static void removeCustomSignatureBuilders(); Signature invokeSigning(); abstract DataToSign buildDataToSign(); abstract Signature openAdESSignature(byte[] signatureDocument); SignatureBuilder withCity(String cityName); SignatureBuilder withStateOrProvince(String stateOrProvince); SignatureBuilder withPostalCode(String postalCode); SignatureBuilder withCountry(String country); SignatureBuilder withRoles(String... roles); SignatureBuilder withSignatureDigestAlgorithm(DigestAlgorithm digestAlgorithm); SignatureBuilder withSignatureProfile(SignatureProfile signatureProfile); SignatureBuilder withSigningCertificate(X509Certificate certificate); SignatureBuilder withSignatureId(String signatureId); SignatureBuilder withSignatureToken(SignatureToken signatureToken); SignatureBuilder withEncryptionAlgorithm(EncryptionAlgorithm encryptionAlgorithm); SignatureBuilder withOwnSignaturePolicy(Policy signaturePolicy);  }### Answer:
@Test public void openSignature_withDataFilesMismatch_shouldBeInvalid() throws Exception { Container container = this.createNonEmptyContainerBy(Paths.get("src/test/resources/testFiles/helper-files/word_file.docx")); Signature signature = this.openAdESSignature(container); ValidationResult result = signature.validateSignature(); Assert.assertFalse(result.isValid()); Assert.assertEquals("The result of the LTV validation process is not acceptable to continue the process!", result.getErrors().get(0).getMessage()); }
@Test public void openXadesSignature_andSavingContainer_shouldNotChangeSignature() throws Exception { Container container = TestDataBuilderUtil.createContainerWithFile("src/test/resources/testFiles/helper-files/word_file.docx"); Signature signature = this.openAdESSignature(container); container.addSignature(signature); String file = this.getFileBy("bdoc"); container.saveAsFile(file); container = ContainerOpener.open(file); byte[] originalSignatureBytes = FileUtils.readFileToByteArray(new File("src/test/resources/testFiles/xades/valid-bdoc-tm.xml")); byte[] signatureBytes = container.getSignatures().get(0).getAdESSignature(); Assert.assertArrayEquals(originalSignatureBytes, signatureBytes); }