@Test
public void testMergeFields3() throws DocumentException, IOException {

    String f1 = "./src/test/resources/com/itextpdf/text/pdf/copy/pdfa-1a.pdf";
    String f2 = "./src/test/resources/com/itextpdf/text/pdf/copy/pdfa-2a.pdf";
    OutputStream outputPdfStream = new ByteArrayOutputStream();
    Document document = new Document();
    PdfACopy copy = new PdfACopy(document, outputPdfStream, PdfAConformanceLevel.PDF_A_1A);
    copy.setMergeFields();
    copy.createXmpMetadata();
    copy.setTagged();
    document.open();
    document.addLanguage("en-US");
    boolean exceptionThrown = false;
    try {
        for (String f : new String[]{f1, f2}) {
            PdfReader reader = new PdfReader(f);
            copy.addDocument(reader);
        }
    } catch (PdfAConformanceException e) {
        if (e.getMessage().contains("Different PDF/A version"))
            exceptionThrown = true;
    }
    if (!exceptionThrown)
        junit.framework.Assert.fail("PdfAConformanceException should be thrown.");
}