DesignPatterns test code