How to Improve For Loop Performance : <p>This code is pretty fast but I would like to make it faster without using HashMap.</p>

<p>I have a list of Accounts and I am currently looping them to check if <code>account.getAccountNumber().equals(accountNumber)</code></p>

<p>Is there a way to improve this using Java 8?</p>

<pre><code>public Account getAccountFromCustomer(String customerID, String accountNumber) {
    List&lt;Account&gt; accounts = getAccountsFromCustomer(customerID);
    for(Account account : accounts) {
        if(account.getAccountNumber().equals(accountNumber)) {
            return account;
        }
    }
    return null;
}
</code></pre>
