code: public static final int[] getDimensionAlignment(int[] firstDimensionNums, int[] secondDimensionNums) {
      int[] alignment = new int[firstDimensionNums.length];
      for (int i = 0; i < firstDimensionNums.length; i++) {
        alignment[i] = Ints.indexOf(secondDimensionNums, firstDimensionNums[i]);
      }
      return alignment;
    }
docs: Gets a mapping from dimensions in {@code firstDimensionNums} to their
  index in {@code secondDimensionNums}. Entries in the alignment are
  -1 for dimensions in {@code firstDimensionNums} that are not in
  {@code secondDimensionNums}.
  
  @param firstDimensionNums
  @param secondDimensionNums
  @return