title: check the values of the arraylist values in java
body: <p>I'm trying to write a method that checks weather all the <code>Objects</code> in an <code>ArrayList</code> have the same value. For example, in the following code <code>list1</code> should return <code>true</code>, and <code>list2</code> should return <code>false</code>...</p>
  
  <pre><code>list1=[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
  list2=[1,3,4,2,4,1,3,4,5,6,2,1,5,2,4,1]
  </code></pre>
  
  <p>What is the best way to write this method? Is there any quick methods to do this, or do I need to manually loop through the values?</p>