commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Median.java [186:205]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    x[start] = x[start + 1];
                    x[start + 1] = t;
                }
                return Interpolation.mean(x[start], x[start + 1]);
            case 1:
                return x[start];
            default:
                return Double.NaN;
            }
        }
        // Median index (including the offset)
        final int m = (start + end) >>> 1;
        // Odd
        if ((n & 0x1) == 1) {
            Selection.select(x, start, end, m);
            return x[m];
        }
        // Even: require (m-1, m)
        Selection.select(x, start, end, new int[] {m - 1, m});
        return Interpolation.mean(x[m - 1], x[m]);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Median.java [268:287]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    x[start] = x[start + 1];
                    x[start + 1] = t;
                }
                return Interpolation.mean(x[start], x[start + 1]);
            case 1:
                return x[start];
            default:
                return Double.NaN;
            }
        }
        // Median index (including the offset)
        final int m = (start + end) >>> 1;
        // Odd
        if ((n & 0x1) == 1) {
            Selection.select(x, start, end, m);
            return x[m];
        }
        // Even: require (m-1, m)
        Selection.select(x, start, end, new int[] {m - 1, m});
        return Interpolation.mean(x[m - 1], x[m]);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



