### Question:
ProtoConversions { private static Timestamp fromLong(Long elapsedSinceEpoch, TimestampPrecise precise) throws IllegalArgumentException { long seconds = 0L; int nanos = 0; switch (precise) { case Millis: seconds = Math.floorDiv(elapsedSinceEpoch, (long) THOUSAND); nanos = (int) Math.floorMod(elapsedSinceEpoch, (long) THOUSAND) * MILLION; break; case Micros: seconds = Math.floorDiv(elapsedSinceEpoch, (long) MILLION); nanos = (int) Math.floorMod(elapsedSinceEpoch, (long) MILLION) * THOUSAND; break; } if (seconds < SECONDS_LOWERLIMIT || seconds > SECONDS_UPPERLIMIT) { throw new IllegalArgumentException("given seconds is out of range"); } if (nanos < NANOSECONDS_LOWERLIMIT || nanos > NANOSECONDS_UPPERLIMIT) { throw new IllegalArgumentException("given nanos is out of range"); } return Timestamp.newBuilder().setSeconds(seconds).setNanos(nanos).build(); }    }### Answer:
@Test(expected = IllegalArgumentException.class) public void testTimestampMillisConversionSecondsLowerLimit() throws Exception { TimestampMillisConversion conversion = new TimestampMillisConversion(); long exceeded = (ProtoConversions.SECONDS_LOWERLIMIT - 1) * 1000; conversion.fromLong(exceeded, TIMESTAMP_MILLIS_SCHEMA, LogicalTypes.timestampMillis()); }
@Test(expected = IllegalArgumentException.class) public void testTimestampMillisConversionSecondsUpperLimit() throws Exception { TimestampMillisConversion conversion = new TimestampMillisConversion(); long exceeded = (ProtoConversions.SECONDS_UPPERLIMIT + 1) * 1000; conversion.fromLong(exceeded, TIMESTAMP_MILLIS_SCHEMA, LogicalTypes.timestampMillis()); }
@Test(expected = IllegalArgumentException.class) public void testTimestampMicrosConversionSecondsLowerLimit() throws Exception { TimestampMicrosConversion conversion = new TimestampMicrosConversion(); long exceeded = (ProtoConversions.SECONDS_LOWERLIMIT - 1) * 1000000; conversion.fromLong(exceeded, TIMESTAMP_MICROS_SCHEMA, LogicalTypes.timestampMicros()); }
@Test(expected = IllegalArgumentException.class) public void testTimestampMicrosConversionSecondsUpperLimit() throws Exception { TimestampMicrosConversion conversion = new TimestampMicrosConversion(); long exceeded = (ProtoConversions.SECONDS_UPPERLIMIT + 1) * 1000000; conversion.fromLong(exceeded, TIMESTAMP_MICROS_SCHEMA, LogicalTypes.timestampMicros()); }