@Test
    public void testNumericNoQuote() {
        StructuredJsonGenerator jw = new SdkJsonGenerator(new JsonFactory(), null);
        jw.writeStartObject();
        jw.writeFieldName("foo").writeValue(new Date(), TimestampFormat.UNIX_TIMESTAMP);
        jw.writeEndObject();
        String s = new String(jw.getBytes(), Charset.forName("UTF-8"));
        // Something like: {"foo":1408378076.135}.
        // Note prior to the changes, it was {"foo":1408414571}
        // (with no decimal point nor places.)
        System.out.println(s);
        final String prefix = "{\"foo\":";
        assertTrue(s, s.startsWith(prefix));
        final int startPos = prefix.length();
        // verify no starting quote for the value
        assertFalse(s, s.startsWith("{\"foo\":\""));
        assertTrue(s, s.endsWith("}"));
        // Not: {"foo":"1408378076.135"}.
        // verify no ending quote for the value
        assertFalse(s, s.endsWith("\"}"));
        final int endPos = s.indexOf("}");
        final int dotPos = s.length()-5;
        assertTrue(s, s.charAt(dotPos) == '.');
        // verify all numeric before '.'
        char[] a = s.toCharArray();
        for (int i=startPos; i < dotPos; i++)
            assertTrue(a[i] <= '9' && a[i] >= '0' );
        int j=0;
        // verify all numeric after '.'
        for (int i=dotPos+1; i < endPos; i++) {
            assertTrue(a[i] <= '9' && a[i] >= '0' );
            j++;
        }
        // verify decimal precision of exactly 3
        assertTrue(j == 3);
    }
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