For example, I have a code like this:
if (morning) {
if (beforeTenAM) {
System.out.println("Go back to sleep"); }
else {
System.out.println("Wake up!"); }
}
else {
System.out.println("It's not morning anymore");
}
How can I represent this nested if else statement in a UML sequence diagram? Is it possible to do so? Or is a communication diagram better in this case?