To rephrase your problem, you are trying to figure out the user name/password pair for a given URL.
Whether we can use Hashmap or ArrayList? Please clarify with an example.
What do you think? Have you read the API docs for both these? Do you understand what type of scenarios they are designed for?
What have you tried so far and where are you stuck?