protected String cutMessageIfNeeded(final String message) {
        return (message.length() > MAX_EXCEPTION_MESSAGE_SIZE)?
            message.substring(0, MAX_EXCEPTION_MESSAGE_SIZE - 3) + "..." : message;

    }
@Test
    public void cutMessageIfNeeded() throws MessageFormatException {
        char[] message = new char[2056];
        Arrays.fill(message, '1');
        String cutMessage = (new WireFormatInfoMarshaller()).cutMessageIfNeeded(String.valueOf(message));
        assertEquals("Expected length " + MAX_MESSAGE_LENGTH, MAX_MESSAGE_LENGTH, cutMessage.length());
        assertTrue("Expected message tail ...", cutMessage.endsWith("..."));
    }