public List<T> subList(int beginIdx,int uptoLength){
  return elements.subList(beginIdx,uptoLength);
}

public List < T > subList ( int beginIdx , int uptoLength ) { return elements . subList ( beginIdx , uptoLength ) ; }
returns a sublist of the elements in the stack .
