class Arrays {

  public static <T> Array<T> slice(Array<T> org, int dim, int value) throws InvalidRangeException {
    ArrayList<Range> ranges = new ArrayList<>(org.getSection().getRanges());
    ranges.set(dim, new Range(value, value));
    Array<T> s = section(org, ranges);
    return reduce(s, dim);
  }

}