Patterns in Java