Design patterns in java test