code: private static int[] getImpostNeighbors(SparseMatrix sm, int rowIndex) {
          int[] impost1edges = sm.getRowVector(rowIndex).getNonZeroIndices();
          int[] neighbors = Arrays.copyOf(impost1edges, impost1edges.length + 1);
          neighbors[neighbors.length - 1] = rowIndex;
          return neighbors;
      }
docs: Returns an array containing the row indices of the neighbors of the
  impost node and the row index of the impost node itself.