@Test
    public void testThatApplyingToWrongTypeFails() {
        DocumentType t1 = new DocumentType("doo");
        DocumentUpdate documentUpdate = new DocumentUpdate(t1, new DocumentId("id:this:doo::is:a:test"));

        DocumentType t2 = new DocumentType("foo");
        Document document = new Document(t2, "id:this:foo::is:another:test");

        try {
            documentUpdate.applyTo(document);
            fail("Should have gotten exception here.");
        } catch (IllegalArgumentException iae) {
            //ok!
        }
    }
Tests applying and serializing document updates.

@author Einar M R Rosenvinge
document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java