Made assertTermKeys order-independent.