public static List<SourceToTargetMapping> getCurrentMappings( List<String> sourceFields, List<String> targetFields, List<MappingValueRename> mappingValues ) {
    List<SourceToTargetMapping> sourceToTargetMapping = new ArrayList<>(  );

    if ( sourceFields == null || targetFields == null || mappingValues == null ) {
      return sourceToTargetMapping;
    }
    if ( !mappingValues.isEmpty() ) {
      for ( MappingValueRename mappingValue : mappingValues ) {
        String source = mappingValue.getSourceValueName();
        String target = mappingValue.getTargetValueName();
        int sourceIndex = sourceFields.indexOf( source );
        int targetIndex = targetFields.indexOf( target );
        sourceToTargetMapping.add( new SourceToTargetMapping( sourceIndex, targetIndex ) );
      }
    }
    return sourceToTargetMapping;
  }
@Test
  public void getCurrentMapping() {
    List<SourceToTargetMapping> currentMapping = MappingUtil.getCurrentMappings( sourceFields, targetFields, mappingValues );

    assertEquals( 2, currentMapping.size() );
    assertEquals( currentMapping.get( 0 ).getSourcePosition(), sourceFields.indexOf( "source1" ) );
    assertEquals( currentMapping.get( 0 ).getTargetPosition(), targetFields.indexOf( "target2" ) );
    assertEquals( currentMapping.get( 1 ).getSourcePosition(), sourceFields.indexOf( "source3" ) );
    assertEquals( currentMapping.get( 1 ).getTargetPosition(), targetFields.indexOf( "target1" ) );
  }