code: public static SourceMapGenerator fromSourceMap(SourceMapConsumer aSourceMapConsumer) {
          String sourceRoot = aSourceMapConsumer.sourceRoot;
          SourceMapGenerator generator = new SourceMapGenerator(aSourceMapConsumer.file, sourceRoot);
          aSourceMapConsumer.eachMapping().forEach(mapping -> {
              Mapping newMapping = new Mapping(mapping.generated);
              if (mapping.source != null) {
                  newMapping.source = mapping.source;
                  if (sourceRoot != null) {
                      newMapping.source = Util.relative(sourceRoot, newMapping.source);
                  }
                  newMapping.original = mapping.original;
                  if (mapping.name != null) {
                      newMapping.name = mapping.name;
                  }
              }
              generator.addMapping(newMapping);
          });
          aSourceMapConsumer.sources().stream().forEach(sourceFile -> {
              String content = aSourceMapConsumer.sourceContentFor(sourceFile, null);
              if (content != null) {
                  generator.setSourceContent(sourceFile, content);
              }
          });
          return generator;
      }
docs: Creates a new SourceMapGenerator based on a SourceMapConsumer
  
  @param aSourceMapConsumer
  The SourceMap.