Codes practice for the Java DesignPatterns