The toString methods generated using code sugar throws NullPointerException if any member variable is of type java.util.List and is null. The code sugar generates the code which takes Iterator over list before checking Null member variable