### Question:
MetaInjectMeta extends BaseTransformMeta implements ITransformMeta<MetaInject, MetaInjectData>, ITransformMetaChangeListener, ISubPipelineAwareMeta { static Map<TargetTransformAttribute, SourceTransformField> convertToMap(List<MetaInjectMapping> metaInjectMapping ) { Map<TargetTransformAttribute, SourceTransformField> targetToSourceMap = new HashMap<TargetTransformAttribute, SourceTransformField>(); for ( MetaInjectMapping mappingEntry : metaInjectMapping ) { if ( !isMappingEntryFilled( mappingEntry ) ) { continue; } TargetTransformAttribute targetTransformAttribute = createTargetTransformAttribute( mappingEntry ); SourceTransformField sourceTransformField = createSourceTransformField( mappingEntry ); targetToSourceMap.put(targetTransformAttribute, sourceTransformField); } return targetToSourceMap; } MetaInjectMeta(); @Override Object clone(); @Override void setDefault(); @Override String getXml(); @Override void loadXml(Node transformNode, IHopMetadataProvider metadataProvider ); @Override void getFields(IRowMeta rowMeta, String origin, IRowMeta[] info, TransformMeta nextTransform,
                        IVariables space, IHopMetadataProvider metadataProvider ); @Override MetaInjectData getTransformData(); Map<TargetTransformAttribute, SourceTransformField> getTargetSourceMapping(); void setTargetSourceMapping( Map<TargetTransformAttribute, SourceTransformField> targetSourceMapping ); String getPipelineName(); void setPipelineName(String pipelineName ); String getFileName(); void setFileName( String fileName ); String getDirectoryPath(); void setDirectoryPath( String directoryPath ); ObjectLocationSpecificationMethod getSpecificationMethod(); void setSpecificationMethod( ObjectLocationSpecificationMethod specificationMethod ); static final synchronized PipelineMeta loadPipelineMeta(MetaInjectMeta injectMeta,
                                                                 IHopMetadataProvider metadataProvider, IVariables space ); @Override List<ResourceReference> getResourceDependencies(PipelineMeta pipelineMeta, TransformMeta transformInfo ); @Override String exportResources(IVariables space, Map<String, ResourceDefinition> definitions,
                                IResourceNaming resourceNamingInterface, IHopMetadataProvider metadataProvider ); @Override boolean excludeFromCopyDistributeVerification(); @Override ITransform createTransform(TransformMeta transformMeta, MetaInjectData data, int copyNr, PipelineMeta pipelineMeta, Pipeline pipeline); @Override boolean excludeFromRowLayoutVerification(); String getSourceTransformName(); void setSourceTransformName(String sourceTransformName ); String getTargetFile(); void setTargetFile( String targetFile ); boolean isNoExecution(); void setNoExecution( boolean noExecution ); @Override String[] getReferencedObjectDescriptions(); @Override boolean[] isReferencedObjectEnabled(); @Override String getActiveReferencedObjectDescription(); @Override IHasFilename loadReferencedObject(int index, IHopMetadataProvider metadataProvider, IVariables space ); String getStreamSourceTransformName(); void setStreamSourceTransformName(String streamSourceTransformName); TransformMeta getStreamSourceTransform(); void setStreamSourceTransform(TransformMeta streamSourceTransform); String getStreamTargetTransformName(); void setStreamTargetTransformName(String streamTargetTransformName); @Override void searchInfoAndTargetTransforms( List<TransformMeta> transforms ); List<MetaInjectOutputField> getSourceOutputFields(); void setSourceOutputFields( List<MetaInjectOutputField> sourceOutputFields ); List<MetaInjectMapping> getMetaInjectMapping(); void setMetaInjectMapping( List<MetaInjectMapping> metaInjectMapping ); void actualizeMetaInjectMapping(); @Override void onTransformChange( PipelineMeta pipelineMeta, TransformMeta oldMeta, TransformMeta newMeta ); @Override String getFilename();  }### Answer:
@Test public void convertToMap() { MetaInjectMapping metaInjectMapping = new MetaInjectMapping(); metaInjectMapping.setSourceTransform(SOURCE_TRANSFORM_NAME); metaInjectMapping.setSourceField( SOURCE_FIELD_NAME ); metaInjectMapping.setTargetTransform(TARGET_TRANSFORM_NAME); metaInjectMapping.setTargetField( TARGET_FIELD_NAME ); Map<TargetTransformAttribute, SourceTransformField> actualResult = MetaInjectMeta.convertToMap( Collections.singletonList( metaInjectMapping ) ); assertEquals( 1, actualResult.size() ); TargetTransformAttribute targetTransformAttribute = actualResult.keySet().iterator().next(); assertEquals(TARGET_TRANSFORM_NAME, targetTransformAttribute.getTransformName() ); assertEquals( TARGET_FIELD_NAME, targetTransformAttribute.getAttributeKey() ); SourceTransformField sourceTransformField = actualResult.values().iterator().next(); assertEquals(SOURCE_TRANSFORM_NAME, sourceTransformField.getTransformName() ); assertEquals( SOURCE_FIELD_NAME, sourceTransformField.getField() ); }