 <p>In general an object can be removed in two ways from an <a href="http://docs.oracle.com/javase/6/docs/api/java/util/ArrayList.html" rel="nofollow"><code>ArrayList</code></a> (or generally any <a href="http://docs.oracle.com/javase/6/docs/api/java/util/List.html" rel="nofollow"><code>List</code></a>), by index (<a href="http://docs.oracle.com/javase/6/docs/api/java/util/List.html#remove%28int%29" rel="nofollow"><code>remove(int)</code></a>) and by object (<a href="http://docs.oracle.com/javase/6/docs/api/java/util/List.html#remove%28java.lang.Object%29" rel="nofollow"><code>remove(Object)</code></a>).</p> <p>In this particular scenario: Add an <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html#equals%28java.lang.Object%29" rel="nofollow"><code>equals(Object)</code></a> method to your <code>ArrayTest</code> class. That will allow <a href="http://docs.oracle.com/javase/6/docs/api/java/util/ArrayList.html#remove%28java.lang.Object%29" rel="nofollow"><code>ArrayList.remove(Object)</code></a> to identify the correct object.</p>