def METHOD_NAME(self) -> None:
    """Test is_valid task_ins for Secure Aggregation."""
    # Prepare
    # (has_legacy_server_message, has_sa)
    valid_ins = [(True, True), (False, True)]
    invalid_ins = [(False, False)]
    # Execute & Assert
    for has_legacy_server_message, has_sa in valid_ins:
        msg = create_task_ins(1, False, has_legacy_server_message, has_sa)
        val_errors = validate_task_ins_or_res(msg)
        self.assertFalse(val_errors)
    for has_legacy_server_message, has_sa in invalid_ins:
        msg = create_task_ins(1, False, has_legacy_server_message, has_sa)
        val_errors = validate_task_ins_or_res(msg)
        self.assertTrue(val_errors)