Add static blocks in java solution.