Tests for queries with indexes on null fields

Issue #3621.
Refactored testNullIndexing test and moved from QueryAdvancedTest into QueryIndexingTest.
Replaced execution time checking with invocation count checking using Mockito.
Counting how many times fields are accessed with indexes and how many times without.