A few Patterns implemented in java