Measuring polarization of high-energy gamma rays