code: private DoubleArrayResult arrangingEnergy(ArrayList<Double> array) {
  
          DoubleArrayResult results = new DoubleArrayResult();
          int count = array.size();
          for (int i = 0; i < count; i++) {
              double min = array.get(0);
              int pos = 0;
              for (int j = 0; j < array.size(); j++) {
                  double value = array.get(j);
                  if (value < min) {
                      min = value;
                      pos = j;
                  }
              }
              array.remove(pos);
              results.add(min);
          }
          return results;
      }
docs: put in increasing order the ArrayList
  
  @param array The ArrayList to order
  @return      The DoubleArrayResult ordered