Here you can find the source of max(Duration a, Duration b)
public static Duration max(Duration a, Duration b)
//package com.java2s; //License from project: Open Source License import java.time.Duration; import java.time.Instant; public class Main { public static Duration max(Duration a, Duration b) { return a.compareTo(b) >= 0 ? a : b; }/*from w ww . j a v a 2 s . com*/ public static Instant max(Instant a, Instant b) { return a.compareTo(b) >= 0 ? a : b; } }