code: private void findBestWithFirst(DatanodeDescriptor first,
        List<DatanodeDescriptor> listOfNodes, DatanodeDescriptor[] result) {
      for (int in2 = 0; in2 < listOfNodes.size(); in2++) {
        DatanodeDescriptor n2 = listOfNodes.get(in2);
        if (!first.equals(n2)) {
          if (result[1] == null && inWindow(first, n2)) {
            result[0] = first;
            result[1] = n2;
          }
  
          for (int in3 = in2 + 1; in3 < listOfNodes.size(); in3++) {
            DatanodeDescriptor n3 = listOfNodes.get(in3);
            if (!first.equals(n3)
                && inWindow(first, n3, n2)) {
              result[0] = first;
              result[1] = n2;
              result[2] = n3;
              return;
            }
          }
        }
      }
    }
docs: Function that finds the best partial triple including a first replica
  @param first first replica to be used
  @param listOfNodes nodes to choose from
  @param result array that stores results