### Question:
DialogUtils { public static String getPathOf( RepositoryElementMetaInterface object ) { if ( object != null && !object.isDeleted() ) { RepositoryDirectoryInterface directory = object.getRepositoryDirectory(); if ( directory != null ) { String path = directory.getPath(); if ( path != null ) { if ( !path.endsWith( "/" ) ) { path += "/"; } path += object.getName(); return path; } } } return null; }  static String getPathOf( RepositoryElementMetaInterface object ); static boolean objectWithTheSameNameExists( SharedObjectInterface object,
      Collection<? extends SharedObjectInterface> scope ); static String getPath( String parentPath, String path );  }### Answer:
@Test public void nullObject() { assertNull( getPathOf( null ) ); }
@Test public void deletedObject() { RepositoryElementMetaInterface object = mock( RepositoryElementMetaInterface.class ); when( object.isDeleted() ).thenReturn( true ); assertNull( getPathOf( object ) ); }
@Test public void nullDirectory() { RepositoryElementMetaInterface object = mock( RepositoryElementMetaInterface.class ); when( object.getRepositoryDirectory() ).thenReturn( null ); assertNull( getPathOf( object ) ); }
@Test public void nullDirectoryPath() { RepositoryElementMetaInterface object = mock( RepositoryElementMetaInterface.class ); RepositoryDirectoryInterface directory = mock( RepositoryDirectoryInterface.class ); when( object.getRepositoryDirectory() ).thenReturn( directory ); assertNull( getPathOf( object ) ); }