Here you can find the source of sleep(final Duration duration)
public static void sleep(final Duration duration)
//package com.java2s; import java.time.Duration; public class Main { /** TODO: Documentation */ public static void sleep(final Duration duration) { try {//w ww. j a v a 2 s. c om Thread.sleep(duration.toMillis()); } catch (final InterruptedException e) { e.printStackTrace(); } } }