Java : I need to make method behave differently for different requests
<pre><code>class A 
if(userAuthenticated)
  ArrayList accounts = getAccountForUser(customerId);
UserInfo userinfo = new UserInfo();
userinfo.getUserInfo(accounts);
}

==============

class UserInfo 
{
public ArrayList&lt;String&gt; getUserInfo(ArrayList list) {
ArrayList useraccounts = list;
return useraccounts;
}
}

===============
</code></pre>

<p>Now inside Class C i will have a String and i need to check , if that String Value exists then do something else do soemthing </p>

<p>The Problem is as this being a WebApplication , i cannot use instance varaibe in the Application .</p>

<pre><code>class C 
{

public String makeDBCALL(String account)
{

Here i need to get that ArrayList  of UserInfo  and check if taht  list.contains(account)) 
could anybody please tell me how can do this .
}
}
</code></pre>
