Tag reduce boiler plate code in java