code: private static int[] createMapping(final MojoModel model, final String[] reference, final String modelName) {
          int[] mapping = new int[reference.length];
          if (model._names.length != reference.length) {
              throw new IllegalStateException(String.format("Model '%s' is expected to have has non-standard number of columns.",
                      modelName));
          }
          boolean foundDifference = false;
          for (int i = 0; i < reference.length; i++) {
              final int pos = findColumnIndex(model._names, reference[i]);
              if (pos == -1) {
                  throw new IllegalStateException(String.format("Model '%s' does not have input column '%s'",
                          modelName, reference[i]));
              }
              if (pos != i) foundDifference = true;
              mapping[i] = pos;
          }
  
          if (foundDifference) {
              return mapping;
          } else return null;
      }
docs: Creates an array of integers with mapping of referential column name space into model-specific column name space.
  
  @param model     Model to create column mapping for
  @param reference Column mapping servig as a reference
  @param modelName Name of the model for various error reports
  @return An array of integers with mapping. Null of no mapping is necessary.