fix test for generate_id_matrix. Add class method to call generate_id_matrix