code: List<Integer> getNeighbours(int rank) {
          if(rank < 0) {
              throw new IllegalStateException("Rank should be non negative");
          }
  
          if(rank >= numWorkers) {
              throw new IllegalStateException("Rank ["+rank+"] too high for the number of workers ["+numWorkers+"]");
          }
  
          rank += 1;
          List<Integer> neighbour = new ArrayList<>();
  
          if(rank > 1) {
              neighbour.add(rank / 2 - 1);
          }
          if(rank * 2 - 1 < numWorkers) {
              neighbour.add(rank * 2 - 1);
          }
          if(rank * 2 < numWorkers) {
              neighbour.add(rank * 2);
          }
  
          return neighbour;
      }
docs: Returns a list containing existing neighbours of a node, this includes at most 3 nodes: parent, left and right child.