I have two classes, Class A and Class B.
Class A has an ArrayList of objects Class B.
Each Class B object has an attribute that stores a Class A object.
So when I create a Class A object, it populates the ArrayList of objects Class B. Each object Class B creates an object Class A (same as the one that is being populated), which creates an ArrayList of objects Class B... and so on.
What should I do to avoid this infinite recursion?