code: public static void oddEvenSort( List<Double> listToBeSorted, List<Double> listThatFollowsTheSort ) {
          for( int i = 0; i < listToBeSorted.size() / 2; i++ ) {
              for( int j = 0; j + 1 < listToBeSorted.size(); j += 2 )
                  if (listToBeSorted.get(j) > listToBeSorted.get(j + 1)) {
                      double tmpa = listToBeSorted.get(j);
                      listToBeSorted.set(j, listToBeSorted.get(j + 1));
                      listToBeSorted.set(j + 1, tmpa);
                      if (listThatFollowsTheSort != null) {
                          double tmpb = listThatFollowsTheSort.get(j);
                          listThatFollowsTheSort.set(j, listThatFollowsTheSort.get(j + 1));
                          listThatFollowsTheSort.set(j + 1, tmpb);
                      }
                  }
              for( int j = 1; j + 1 < listToBeSorted.size(); j += 2 )
                  if (listToBeSorted.get(j) > listToBeSorted.get(j + 1)) {
                      double tmpa = listToBeSorted.get(j);
                      listToBeSorted.set(j, listToBeSorted.get(j + 1));
                      listToBeSorted.set(j + 1, tmpa);
                      if (listThatFollowsTheSort != null) {
                          double tmpb = listThatFollowsTheSort.get(j);
                          listThatFollowsTheSort.set(j, listThatFollowsTheSort.get(j + 1));
                          listThatFollowsTheSort.set(j + 1, tmpb);
                      }
                  }
          }
      }
docs: Sorts two lists regarding to the sort of the first
  
  @param listToBeSorted the array on wich the sort is performed
  @param listThatFollowsTheSort the array that is sorted following the others list sort. Can be
  null, in which case it acts like a normal sorting algorithm