private FileStatus createMockFileStatus(Path p) {
    FileStatus mock = Mockito.mock(FileStatus.class);
    when(mock.getPath()).thenReturn(p);
    if (p.toString().contains("datafile")) {
      when(mock.isDirectory()).thenReturn(false);
    } else {
      when(mock.isDirectory()).thenReturn(true);
    }
    return mock;
  }
Test counts the number of listStatus calls in the msck core method of
listing sub-directories. This is important to check since it unnecessary
listStatus calls could cause performance degradation in remote filesystems
like S3. The test creates a mock FileSystem object and a mock directory structure
to simulate a table which has 2 partition keys and 2 partition values at each level.
In the end it counts how many times the listStatus is called on the mock filesystem
and confirm its equal to the current theoretical value.

@throws IOException
@throws MetastoreException
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestMsckCheckPartitions.java