Patterns implemented on Java