import java.util.concurrent.CountDownLatch; class StekKj?ttTraad implements Runnable{ @Override public void run(){ try { System.out.println("Steker kj?tt"); Thread.sleep((int)(Math.random() * 5000)); } catch (InterruptedException e){ System.out.println("Ble avbrutt under steking av kj?tt"); System.exit(1); } } }