/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

import java.util.concurrent.* ;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		System.out.println( "start" ) ;

ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor();
Runnable runnable = () -> System.out.println("I am a runnable");
ses.schedule(runnable, 1, TimeUnit.SECONDS);
ses.scheduleWithFixedDelay(runnable, 1, 1, TimeUnit.SECONDS);
ses.scheduleAtFixedRate(runnable, 2, 1, TimeUnit.SECONDS);

Thread.sleep( 1_000 * 5 ) ;
ses.shutdown();

    Thread.sleep( 1_000 * 5 ) ;
    ses.awaitTermination( 10 , TimeUnit.SECONDS ) ;

    System.out.println( "stop" ) ;

	}
}