### Question:
UTCTimestampField extends AbstractField<ZonedDateTime> { @Override public byte[] getBytes() { switch (valueLen) { case 17: return DATE_TIME_FORMATTER_SECONDS.format(value).getBytes(US_ASCII); case 21: return DATE_TIME_FORMATTER_MILLIS.format(value).getBytes(US_ASCII); case 24: return DATE_TIME_FORMATTER_MICROS.format(value).getBytes(US_ASCII); case 27: return DATE_TIME_FORMATTER_NANOS.format(value).getBytes(US_ASCII); case 30: return DATE_TIME_FORMATTER_PICOS.format(value).getBytes(US_ASCII); default: if (valueLen > DATE_TIME_PATTERN_PICOS_LENGTH) { return DATE_TIME_FORMATTER_PICOS.format(value).getBytes(US_ASCII); } else if (valueLen > DATE_TIME_PATTERN_NANOS_LENGTH) { return DATE_TIME_FORMATTER_NANOS.format(value).getBytes(US_ASCII); } else if (valueLen > DATE_TIME_PATTERN_MICROS_LENGTH) { return DATE_TIME_FORMATTER_MICROS.format(value).getBytes(US_ASCII); } else if (valueLen > DATE_TIME_PATTERN_MILLIS_LENGTH) { return DATE_TIME_FORMATTER_MILLIS.format(value).getBytes(US_ASCII); } else { return DATE_TIME_FORMATTER_SECONDS.format(value).getBytes(US_ASCII); } } } UTCTimestampField(int tagNum, byte[] bytes, int offset, int length);  UTCTimestampField(int tagNum, String timestampString);  UTCTimestampField(int tagNum, ZonedDateTime value); static ZonedDateTime parse(byte[] bytes); static ZonedDateTime parse(byte[] bytes, int offset, int length); static ZonedDateTime parse(String timestampString); @Override ZonedDateTime getValue(); @Override byte[] getBytes(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testGetBytesNoMillis() throws Exception { int tag = new Random().nextInt(); byte[] bytes = TIMESTAMP_NO_MILLIS.getBytes(); UTCTimestampField field = new UTCTimestampField(tag, bytes, 0, bytes.length); assertArrayEquals(bytes, field.getBytes()); }
@Test public void testGetBytesWithMillis() throws Exception { int tag = new Random().nextInt(); byte[] bytes = TIMESTAMP_WITH_MILLIS.getBytes(); UTCTimestampField field = new UTCTimestampField(tag, bytes, 0, bytes.length); assertArrayEquals(bytes, field.getBytes()); }
@Test public void testGetBytesMicros() throws Exception { int tag = new Random().nextInt(); byte[] bytes = TIMESTAMP_WITH_MICROS.getBytes(); UTCTimestampField field = new UTCTimestampField(tag, bytes, 0, bytes.length); assertArrayEquals(bytes, field.getBytes()); }
@Test public void testGetBytesNanos() throws Exception { int tag = new Random().nextInt(); byte[] bytes = TIMESTAMP_WITH_NANOS.getBytes(); UTCTimestampField field = new UTCTimestampField(tag, bytes, 0, bytes.length); assertArrayEquals(bytes, field.getBytes()); }
@Test public void testGetBytesPicos() throws Exception { int tag = new Random().nextInt(); byte[] bytes = TIMESTAMP_WITH_PICOS.getBytes(); UTCTimestampField field = new UTCTimestampField(tag, bytes, 0, bytes.length); byte[] nanosBytes = (TIMESTAMP_WITH_NANOS+"000").getBytes(); assertArrayEquals(nanosBytes, field.getBytes()); }