code: public static <T, E extends Exception> DoubleList mapToDouble(final Collection<? extends T> c, final int fromIndex, final int toIndex,
              final Try.ToDoubleFunction<? super T, E> func) throws E {
          checkFromToIndex(fromIndex, toIndex, size(c));
          N.checkArgNotNull(func);
  
          if (N.isNullOrEmpty(c) && fromIndex == 0 && toIndex == 0) {
              return new DoubleList();
          }
  
          final DoubleList result = new DoubleList(toIndex - fromIndex);
  
          if (c instanceof List && c instanceof RandomAccess) {
              final List<T> list = (List<T>) c;
  
              for (int i = fromIndex; i < toIndex; i++) {
                  result.add(func.applyAsDouble(list.get(i)));
              }
          } else {
              int idx = 0;
  
              for (T e : c) {
                  if (idx++ < fromIndex) {
                      continue;
                  }
  
                  result.add(func.applyAsDouble(e));
  
                  if (idx >= toIndex) {
                      break;
                  }
              }
          }
  
          return result;
      }
docs: Mostly it's designed for one-step operation to complete the operation in one step.
  <code>java.util.stream.Stream</code> is preferred for multiple phases operation.
  
  @param a
  @param fromIndex
  @param toIndex
  @param func
  @return