Hamas leaders called the measure " illegitimate " and vowed to overturn it when the group takes over the legislature Saturday .