@Test
    public void parseServiceSpecificDate_longerThan20Char_throws() {
        int len = 21;
        StringBuilder sb = new StringBuilder(len);
        for (int i = 0; i < len; ++i) {
            sb.append('9');
        }

        Exception caught = null;
        try {
            DateUtils.parseServiceSpecificDate(sb.toString());
            fail("parseServiceSpecificDate should have thrown");
        } catch (Exception e) {
            caught = e;
        } finally {
            assertTrue(caught.getMessage().contains("no longer than 20"));
        }
    }
Tests the Date marshalling and unmarshalling. Asserts that the value is
same before and after marshalling/unmarshalling
aws-java-sdk-core/src/test/java/com/amazonaws/util/DateUtilsTest.java