### Question:
TemporalUtil { public static long getNanosOfDayUTC( OffsetTime value ) { long secondsOfDayLocal = value.toLocalTime().toSecondOfDay(); long secondsOffset = value.getOffset().getTotalSeconds(); return (secondsOfDayLocal - secondsOffset) * NANOS_PER_SECOND + value.getNano(); } private  TemporalUtil(); static OffsetTime truncateOffsetToMinutes( OffsetTime value ); static long nanosOfDayToUTC( long nanosOfDayLocal, int offsetSeconds ); static long nanosOfDayToLocal( long nanosOfDayUTC, int offsetSeconds ); static long getNanosOfDayUTC( OffsetTime value ); static final long NANOS_PER_SECOND; static final long AVG_NANOS_PER_MONTH; static final long SECONDS_PER_DAY; static final long AVG_SECONDS_PER_MONTH; static final double AVG_DAYS_PER_MONTH; }### Answer:
@Test void shouldGetNanosOfDayUTC() { LocalTime localTime = LocalTime.of( 14, 19, 18, 123999 ); ZoneOffset offset = ZoneOffset.ofHours( -12 ); OffsetTime time = OffsetTime.of( localTime, offset ); long nanosOfDayUTC = TemporalUtil.getNanosOfDayUTC( time ); long expectedNanosOfDayUTC = Duration.ofSeconds( localTime.toSecondOfDay() ) .minus( offset.getTotalSeconds(), SECONDS ) .toNanos(); assertEquals( expectedNanosOfDayUTC + localTime.getNano(), nanosOfDayUTC ); }