### Question:
KettleAnalyzerUtil { public static TransMeta getSubTransMeta( final ISubTransAwareMeta meta ) throws MetaverseAnalyzerException { final TransMeta parentTransMeta = meta.getParentStepMeta().getParentTransMeta(); final Repository repo = parentTransMeta.getRepository(); TransMeta subTransMeta = null; switch ( meta.getSpecificationMethod() ) { case FILENAME: subTransMeta = getSubTransByFilename( meta, parentTransMeta, repo, subTransMeta ); break; case REPOSITORY_BY_NAME: if ( repo != null ) { subTransMeta = getTransMetaFromRepo( meta, parentTransMeta, repo ); } else { throw new MetaverseAnalyzerException( Messages.getString( "ERROR.MissingConnectionForTransSubTrans", parentTransMeta.toString() ) ); } break; case REPOSITORY_BY_REFERENCE: if ( repo != null ) { try { subTransMeta = repo.loadTransformation( meta.getTransObjectId(), null ); } catch ( KettleException e ) { throw new MetaverseAnalyzerException( Messages.getString( "ERROR.SubTransNotFoundInParentTrans", ( meta.getTransObjectId() == null ? "N/A" : meta.getTransObjectId().toString() ), parentTransMeta .toString() ), e ); } } else { throw new MetaverseAnalyzerException( Messages.getString( "ERROR.MissingConnectionForTransSubTrans", parentTransMeta.toString() ) ); } break; } subTransMeta.setFilename( KettleAnalyzerUtil.getSubTransMetaPath( meta, subTransMeta ) ); return subTransMeta; }  static String normalizeFilePath( String filePath ); static String normalizeFilePathSafely( String filePath ); static Collection<IExternalResourceInfo> getResourcesFromMeta(
    final BaseStepMeta meta, final String[] filePaths ); static Collection<IExternalResourceInfo> getResourcesFromRow(
    BaseFileInputStep step, RowMetaInterface rowMeta, Object[] row ); static TransMeta getSubTransMeta( final ISubTransAwareMeta meta ); static String getSubTransMetaPath( final ISubTransAwareMeta meta, final TransMeta subTransMeta ); static TransMeta getSubTransMeta( final String filePath ); static IDocument buildDocument( final IMetaverseBuilder builder, final AbstractMeta meta,
                                         final String id, final INamespace namespace ); static String getFilename( TransMeta transMeta ); static String getFilename( JobMeta jobMeta ); static IMetaverseNode analyze( final StepAnalyzer analyzer, final TransMeta transMeta,
                                        final ISubTransAwareMeta meta,
                                        final IMetaverseNode rootNode ); static boolean consolidateSubGraphs();  }### Answer:
@Test public void testGetSubTransMeta() throws MetaverseAnalyzerException, KettleException { final ISubTransAwareMeta meta = Mockito.mock( ISubTransAwareMeta.class ); final TransMeta subTransMeta = Mockito.mock( TransMeta.class ); final StepMeta parentStepMeta = Mockito.mock( StepMeta.class ); final TransMeta parentTransMeta = Mockito.mock( TransMeta.class ); final Repository repo = Mockito.mock( Repository.class ); final RepositoryDirectoryInterface repositoryDirectoryInterface = Mockito.mock( RepositoryDirectoryInterface.class ); Mockito.doReturn( ObjectLocationSpecificationMethod.FILENAME ).when( meta ).getSpecificationMethod(); Mockito.doReturn( parentStepMeta ).when( meta ).getParentStepMeta(); Mockito.doReturn( parentTransMeta ).when( parentStepMeta ).getParentTransMeta(); Mockito.doReturn( repo ).when( parentTransMeta ).getRepository(); Mockito.doReturn( "/some/path/to/foo" ).when( meta ).getFileName(); Mockito.doReturn( repositoryDirectoryInterface ).when( repo ).findDirectory( "/some/path/to" ); Mockito.doReturn( subTransMeta ).when( repo ).loadTransformation( "foo", repositoryDirectoryInterface, null, true, null ); Mockito.doReturn( "/some/path/to/foo" ).when( parentTransMeta ).environmentSubstitute( "/some/path/to/foo" ); assertTrue( KettleAnalyzerUtil.getSubTransMeta( meta ).equals( subTransMeta ) ); }