/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.time.*;
import java.time.temporal.*;
import java.time.format.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
LocalTime start = LocalTime.parse( "12:03:00" );
LocalTime stop = LocalTime.parse( "00:00:00" );
if( stop.equals( LocalTime.MIN ) ) {
stop = LocalTime.MAX ; // `23:59:59.999999999`
}
Duration d = Duration.between( start , stop );
d = d.plusNanos( 1 ).withNanos( 0 ) ;
System.
out.
println( "start/stop: " + start
+ "/" + stop
); System.
out.
println( "d: " + d
);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgppbXBvcnQgamF2YS50aW1lLio7CmltcG9ydCBqYXZhLnRpbWUudGVtcG9yYWwuKjsKaW1wb3J0IGphdmEudGltZS5mb3JtYXQuKjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgogICAgTG9jYWxUaW1lIHN0YXJ0ID0gTG9jYWxUaW1lLnBhcnNlKCAiMTI6MDM6MDAiICk7CiAgICBMb2NhbFRpbWUgc3RvcCA9IExvY2FsVGltZS5wYXJzZSggIjAwOjAwOjAwIiApOwogICAgCiAgICBpZiggc3RvcC5lcXVhbHMoIExvY2FsVGltZS5NSU4gKSApIHsKICAgIAlzdG9wID0gTG9jYWxUaW1lLk1BWCA7IC8vIGAyMzo1OTo1OS45OTk5OTk5OTlgCiAgICB9CiAgICAKICAgIER1cmF0aW9uIGQgPSBEdXJhdGlvbi5iZXR3ZWVuKCBzdGFydCAsIHN0b3AgKTsKICAgIGQgPSBkLnBsdXNOYW5vcyggMSApLndpdGhOYW5vcyggMCApIDsKICAgIAogICAgU3lzdGVtLm91dC5wcmludGxuKCAic3RhcnQvc3RvcDogIiArIHN0YXJ0ICsgIi8iICsgc3RvcCApOwogICAgU3lzdGVtLm91dC5wcmludGxuKCAiZDogIiArIGQgKTsKICAgIAoJfQp9