> with pattern matching for switch (JEP 406)the compiler can confirm that every permitted subclass of Shape is covered, so no default clause or other total pattern is needed. The compiler will, moreover, issue an error message if any of the three cases is missing
Will the compiler check that you have handled all the cases still? (Genuinely unsure — not a Java programmer)