code: public static INDArrayIndex[] resolve(INDArrayIndex[] allIndex, INDArrayIndex... intendedIndexes) {
  
          int numNewAxes = numNewAxis(intendedIndexes);
          INDArrayIndex[] all = new INDArrayIndex[allIndex.length + numNewAxes];
          Arrays.fill(all, NDArrayIndex.all());
          for (int i = 0; i < allIndex.length; i++) {
              //collapse single length indexes in to point indexes
              if (i >= intendedIndexes.length)
                  break;
  
              if (intendedIndexes[i] instanceof NDArrayIndex) {
                  NDArrayIndex idx = (NDArrayIndex) intendedIndexes[i];
                  if (idx.indices.length == 1)
                      intendedIndexes[i] = new PointIndex(idx.indices[0]);
              }
              all[i] = intendedIndexes[i];
          }
  
          return all;
      }
docs: Given an all index and
  the intended indexes, return an
  index array containing a combination of all elements
  for slicing and overriding particular indexes where necessary
  @param allIndex the index containing all elements
  @param intendedIndexes the indexes specified by the user
  @return the resolved indexes (containing all where nothing is specified, and the intended index
  for a particular dimension otherwise)