Refactor logical operator tests to use array.