### Question:
HttpProtocolGeneratorUtils { public static String getTimestampInputParam( GenerationContext context, String dataSource, Shape shape, Format format ) { switch (format) { case DATE_TIME: return "(" + dataSource + ".toISOString().split('.')[0]+\"Z\")"; case EPOCH_SECONDS: return "Math.round(" + dataSource + ".getTime() / 1000)"; case HTTP_DATE: context.getWriter().addImport("dateToUtcString", "__dateToUtcString", "@aws-sdk/smithy-client"); return "__dateToUtcString(" + dataSource + ")"; default: throw new CodegenException("Unexpected timestamp format `" + format.toString() + "` on " + shape); } } private  HttpProtocolGeneratorUtils(); static String getTimestampInputParam(
            GenerationContext context,
            String dataSource,
            Shape shape,
            Format format
    ); static String getTimestampOutputParam(String dataSource, Location bindingType, Shape shape, Format format); static void writeRetryableTrait(TypeScriptWriter writer, StructureShape error, String separator);  }### Answer:
@Test public void givesCorrectTimestampSerialization() { GenerationContext mockContext = new GenerationContext(); TypeScriptWriter writer = new TypeScriptWriter("foo"); mockContext.setWriter(writer); TimestampShape shape = TimestampShape.builder().id("com.smithy.example#Foo").build(); assertThat("(" + DATA_SOURCE + ".toISOString().split('.')[0]+\"Z\")", equalTo(HttpProtocolGeneratorUtils.getTimestampInputParam(mockContext, DATA_SOURCE, shape, Format.DATE_TIME))); assertThat("Math.round(" + DATA_SOURCE + ".getTime() / 1000)", equalTo(HttpProtocolGeneratorUtils.getTimestampInputParam(mockContext, DATA_SOURCE, shape, Format.EPOCH_SECONDS))); assertThat("__dateToUtcString(" + DATA_SOURCE + ")", equalTo(HttpProtocolGeneratorUtils.getTimestampInputParam(mockContext, DATA_SOURCE, shape, Format.HTTP_DATE))); }