code: public static RelatedItemInfo[][] relatedIds(RelatedItemInfo[] ids, int length) {
          int len = length;
          RelatedItemInfo[][] idSets = new RelatedItemInfo[len][len];
          for(int j = 0;j<len;j++) {
              idSets[0][j] = ids[j];
          }
  
          for(int i=1;i<len;i++) {
              int k=0;
              for(int j=i;j<len;j++) {
                  idSets[i][k++] = ids[j];
              }
              for(int j=0;j<i;j++) {
                  idSets[i][k++] = ids[j];
              }
          }
  
          return idSets;
      }
docs: Given a list of ids {"1","2","3","5"}
  
  The method returns list of ids, where each id, is returned
  with a link to the other ids in the list that it is related to.
  
  for example:
  
  1 -> 2, 3, 5
  2 -> 3, 5, 1
  3 -> 5, 1, 2
  5 -> 1, 2, 3
  
  The item that is related to the the other items, is the last element in the returned
  array (X marks the spot below)
  
  i.e.
  X
  [
  [ 2, 3, 5, 1 ],
  [ 3, 5, 1, 2 ],
  [ 5, 1, 2, 3 ],
  [ 1, 2, 3, 5 ]
  ]