protected Repository getDelegate() {
    if ( this.delegate != null ) {
      return this.delegate;
    }
    Repository repository = null;
    try {
      repository = (Repository) purPluginClassLoader.loadClass( "org.pentaho.di.repository.pur.PurRepository" ).newInstance();
    } catch ( Exception e ) {
      logger.error( "Unable to load delegate class for plugin id \"{}\". PUR plugin is most likely not installed or "
          + "changed id.", PUR_PLUGIN_ID );
    }
    return this.delegate = repository;
  }
@Test
  public void getDelegateTest() {
    Repository repository = null;

    try {
      Mockito.<Class<?>>when( mockClassLoader.loadClass( anyString() ) ).thenReturn( Class.forName( "org.pentaho"
          + ".di.repository.pur.PurRepository" ) );
    } catch ( ClassNotFoundException e ) {
      e.printStackTrace();
    }

    repository = proxy.getDelegate();

    assertNotNull( repository );
  }