Platform { public abstract long nextTraceIdHigh();  @Nullable abstract String getHostString(InetSocketAddress socket); @Nullable String linkLocalIp(); AssertionError assertionError(String message, Throwable cause); static Platform get(); void log(String msg, @Nullable Throwable thrown); void log(String msg, Object param1, @Nullable Throwable thrown); abstract long randomLong(); abstract long nextTraceIdHigh(); Clock clock();  }
@Test public void randomLong_epochSecondsPlusRandom() { mockStatic(System.class); when(System.currentTimeMillis()) .thenReturn(1465510280_000L); long traceIdHigh = platform.nextTraceIdHigh(); assertThat(HexCodec.toLowerHex(traceIdHigh)).startsWith("5759e988"); }
@Test public void randomLong_whenRandomIsMostNegative() { mockStatic(System.class); when(System.currentTimeMillis()).thenReturn(1465510280_000L); long traceIdHigh = Platform.nextTraceIdHigh(0xffffffff); assertThat(HexCodec.toLowerHex(traceIdHigh)) .isEqualTo("5759e988ffffffff"); }