 <p>If you always want to do a lookup on the string after the first space, then maybe you don't want to use an ArrayList</p> <p>Maybe you should use a <code>Map&lt;String, String&gt;</code> of product, full name e.g. <code>"S4", "Samsung S4"</code> Then lookups will be much faster.</p>