@Test
    public void requireThatTooLongPreNamespaceSpecificThrowsOnConstruction() {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < 0xff00; i++) {
            builder.append('n');
        }
        try {
            new IdIdString(builder.toString(), "type", "", "namespacespecificpart_01");
            fail();
        } catch (IllegalArgumentException e) {
            assertEquals("Length of namespace(65280) + doctype(4) + key/values(0), is longer than 65275", e.getMessage());
        }
    }
Created with IntelliJ IDEA.
User: magnarn
Date: 10/16/12
Time: 9:10 AM
document/src/test/java/com/yahoo/document/IdIdStringTest.java