### Question:
JobEntryTrans extends JobEntryBase implements Cloneable, JobEntryInterface, HasRepositoryDirectories, JobEntryRunConfigurableInterface { @Override public void setParentJobMeta( JobMeta parentJobMeta ) { JobMeta previous = getParentJobMeta(); super.setParentJobMeta( parentJobMeta ); if ( parentJobMeta != null ) { parentJobMeta.addCurrentDirectoryChangedListener( currentDirListener ); variables.setParentVariableSpace( parentJobMeta ); } else if ( previous != null ) { previous.removeCurrentDirectoryChangedListener( currentDirListener ); } } JobEntryTrans( String name );  JobEntryTrans(); @Override Object clone(); void setFileName( String n ); @Deprecated String getFileName(); @Override String getFilename(); @Override String getRealFilename(); void setTransname( String transname ); String getTransname(); String getDirectory(); void setDirectory( String directory ); @Override String[] getDirectories(); @Override void setDirectories( String[] directories ); String getLogFilename(); @Override String getXML(); @Override void loadXML( Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers,
                       Repository rep, IMetaStore metaStore ); @Override void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
                       List<SlaveServer> slaveServers ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ); @Override void clear(); @Override Result execute( Result result, int nr ); @Deprecated TransMeta getTransMeta( Repository rep, VariableSpace space ); TransMeta getTransMeta( Repository rep, IMetaStore metaStore, VariableSpace space ); @Override boolean evaluates(); @Override boolean isUnconditional(); @Override List<SQLStatement> getSQLStatements( Repository repository, IMetaStore metaStore, VariableSpace space ); String getDirectoryPath(); void setDirectoryPath( String directoryPath ); boolean isClustering(); void setClustering( boolean clustering ); @Override void check( List<CheckResultInterface> remarks, JobMeta jobMeta, VariableSpace space,
                     Repository repository, IMetaStore metaStore ); @Override List<ResourceReference> getResourceDependencies( JobMeta jobMeta ); @Override String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
                                 ResourceNamingInterface namingInterface, Repository repository, IMetaStore metaStore ); String getRemoteSlaveServerName(); void setRemoteSlaveServerName( String remoteSlaveServerName ); boolean isWaitingToFinish(); void setWaitingToFinish( boolean waitingToFinish ); boolean isFollowingAbortRemotely(); void setFollowingAbortRemotely( boolean followingAbortRemotely ); boolean isLoggingRemoteWork(); void setLoggingRemoteWork( boolean loggingRemoteWork ); boolean isPassingAllParameters(); void setPassingAllParameters( boolean passingAllParameters ); String getRunConfiguration(); void setRunConfiguration( String runConfiguration ); Trans getTrans(); ObjectId getTransObjectId(); void setTransObjectId( ObjectId transObjectId ); ObjectLocationSpecificationMethod getSpecificationMethod(); @Override ObjectLocationSpecificationMethod[] getSpecificationMethods(); void setSpecificationMethod( ObjectLocationSpecificationMethod specificationMethod ); @Override boolean hasRepositoryReferences(); @Override void lookupRepositoryReferences( Repository repository ); @Override String[] getReferencedObjectDescriptions(); @Override boolean[] isReferencedObjectEnabled(); @Override Object loadReferencedObject( int index, Repository rep, IMetaStore metaStore, VariableSpace space ); @Override void setParentJobMeta( JobMeta parentJobMeta ); public String[] arguments; public boolean argFromPrevious; public boolean paramsFromPrevious; public boolean execPerRow; public String[] parameters; public String[] parameterFieldNames; public String[] parameterValues; public boolean clearResultRows; public boolean clearResultFiles; public boolean createParentFolder; public boolean setLogfile; public boolean setAppendLogfile; public String logfile; public boolean addDate; public LogLevel logFileLevel; public boolean waitingToFinish; public boolean followingAbortRemotely; }### Answer:
@Test public void testCurrDirListener() throws Exception { JobMeta meta = mock( JobMeta.class ); JobEntryTrans jet = getJobEntryTrans(); jet.setParentJobMeta( meta ); jet.setParentJobMeta( null ); verify( meta, times( 1 ) ).addCurrentDirectoryChangedListener( any() ); verify( meta, times( 1 ) ).removeCurrentDirectoryChangedListener( any() ); }