@@ -0,0 +1,623 @@
+public class ChainOfResponsibilityExample %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        // Build the chain of responsibility%0A        Logger l,l1;%0A        l1 = l = new StdoutLogger(Logger.DEBUG);%0A        l1 = l1.setNext(new EmailLogger(Logger.NOTICE));%0A        l1 = l1.setNext(new StderrLogger(Logger.ERR));%0A%0A        // Handled by StdoutLogger%0A        l.message(%22Entering function y.%22, Logger.DEBUG);%0A%0A        // Handled by StdoutLogger and EmailLogger%0A        l.message(%22Step1 completed.%22, Logger.NOTICE);%0A%0A        // Handled by all three loggers%0A        l.message(%22An error has occurred.%22, Logger.ERR);%0A    %7D%0A%0A%7D%0A

Create ChainOfResponsibilityExample.java