Consumer Producer model in java