In order for a class to be serializable, either:
1) Each type which it encapsulates must also be serializable
or
2) That field must be marked as transient (which means they are not serialized)
Let's look at the types your Bank class is using:
The first three are all serializable (as we can see from their JavaDocs) so there's no problem there.
Set is not by definition serializable but all of the implementations in java.util
are so you're probably safe. However, if you're relying on the set being serializable you should probably change your definition so it's more explicit:
HashMap<Integer, HashSet<Account>> bank;
Person and Account are classes which I assume you've written yourself. You haven't provided them but make sure that they also implement serializable. If they aren't also serializable, I believe your ArrayList will throw an exception if you try to serialize it.
Additionally, make sure your serializable classes contain a serialVersionUID
. What is a serialVersionUID and why should I use it?