title: Determine a range (interval) of integer values in an arrayList
body: <p>I want to develop a function which works as a filter through a set of integers in an arrayList. Basically I will have to retrieve the max and min values in an arrayList.</p>
  
  <p>Example: min= 1970 AND max=2012 (talking about years, but they are treated as simple integers)</p>
  
  <p>I have to determine a range of five-years, so that the output would be </p>
  
  <p>"From 1970 to 1975" onclick I will have the list "1970","1971","1972","1973", "1974","1975"
  "From 1970 to 1975".......
  ......
  "From 2010 to 2012" onclick I will have the list "2010","2011", "2012"</p>
  
  <p>I have previously used pattern/matcher in order to create intervals alphabetically, where I would classify strings in the right alphabetical range (ex. from A to B) but this is different since I have to define a range of 5, and create subarrays.</p>
  
  <p>Please help.</p>
  
  <p>Thanks</p>