The Java 15 support for Sealed classes works much like an Enum in that you have to know the set of possible types up-front. It is often useful to be able to represent and use an ad-hoc SumType as a union of existing types that don't even belong to the same package/library.