public Bucket split() {
      int mc = -1;
      int maxDiff = Integer.MIN_VALUE;
      for (int c = 0; c < 3; c++) {
        int diff = maxC[c] - minC[c];
        if (diff > maxDiff) {
          maxDiff = diff;
          mc = c;
        }
      }
      final int fmc = mc;
      Collections.sort(colors, (o1, o2) -> ColorUtil.getComponent(o1, fmc) - ColorUtil.getComponent(o2, fmc));
      int minComponent = ColorUtil.getComponent(colors.get(0), mc);
      int medianComponent = ColorUtil.getComponent(colors.get((colors.size()+1)/2), mc);
      if (medianComponent == minComponent)
        medianComponent++;
      ArrayList<Long> tmpColors = colors;
      reset();
      Bucket upper = new Bucket();
      for (long color : tmpColors) {
        if (ColorUtil.getComponent(color, mc) >= medianComponent)
          upper.add(color);
        else
          this.add(color);
      }
      return upper;
    }