public void refresh() {
    kidElementCache = null;
    kidDirectoryCache = null;
    rd.clear();
    populateChildren();
    try {
      if ( obj != null ) {
        getRepositoryObjects();
      }
    } catch ( KettleException ignored ) {
      // Ignored
    }
    fireCollectionChanged();
  }
@Test
  public void testRefresh() throws Exception {
    RepositoryDirectory rd = Mockito.mock( RepositoryDirectory.class );
    Mockito.when( rd.getObjectId() ).thenReturn( new LongObjectId( 0L ) );
    UIRepositoryDirectory uiDir = new UIRepositoryDirectory( rd, null, null );
    uiDir.populateChildren();
    uiDir.getRepositoryObjects();
    uiDir.clear();
    Mockito.verify( rd ).getChildren();
    Mockito.verify( rd ).getRepositoryObjects();
  }