Replace manual casting with guavas checkedCast