@Override
  public IMetaStore getMetastore() {
    return getMetastore( null );
  }
@Test
  public void testGetMetastoreTest() {
    //Test that repository metastore gets returned if both local and repository metastore providers exist.
    //Also test that both providers can be accessed directly.
    MetastoreProvider localProvider = mock( MetastoreProvider.class );
    IMetaStore localMeta = mock( IMetaStore.class );
    when( localProvider.getMetastore() ).thenReturn( localMeta );
    when( localProvider.getProviderType() ).thenReturn( MetastoreLocator.LOCAL_PROVIDER_KEY );
    MetastoreProvider repoProvider = mock( MetastoreProvider.class );
    IMetaStore repoMeta = mock( IMetaStore.class );
    when( repoProvider.getMetastore() ).thenReturn( repoMeta );
    when( repoProvider.getProviderType() ).thenReturn( MetastoreLocator.REPOSITORY_PROVIDER_KEY );
    Collection<MetastoreProvider> providerCollection = new ArrayList<>();
    providerCollection.add( localProvider );
    try ( MockedStatic<PluginServiceLoader> pluginServiceLoaderMockedStatic = Mockito.mockStatic( PluginServiceLoader.class ) ) {
      pluginServiceLoaderMockedStatic.when( () -> PluginServiceLoader.loadServices( MetastoreProvider.class ) )
        .thenReturn( providerCollection );

      // only local provider exists
      assertEquals( localMeta, metastoreLocator.getMetastore() );
      providerCollection.clear();
      providerCollection.add( repoProvider );
      // only repo provider exists
      assertEquals( repoMeta, metastoreLocator.getMetastore() );
      providerCollection.add( localProvider );

      // both providers exist
      assertEquals( localMeta, metastoreLocator.getExplicitMetastore( MetastoreLocator.LOCAL_PROVIDER_KEY ) );
      assertEquals( repoMeta, metastoreLocator.getExplicitMetastore( MetastoreLocator.REPOSITORY_PROVIDER_KEY ) );
    }
  }