 //define a functional interface
@FunctionalInterface
interface WorkerInterface { 
    public void doSomeWork(); 
}
class wi implements WorkerInterface
{ public void doSomeWork() 
  {System.out.println("Worker invoked outside  class");}
}

public class WorkerInterfaceTest1 { 
    public static void execute(WorkerInterface worker) {
        worker.doSomeWork();
    }
 
    public static void main(String [] args) 
    { 
        //invoke doSomeWork using outside class
        wi w=new wi();
        execute(w);     
    }
}
