By default, Hilla does its best to translate Java semantics, so almost everything is nullable.
When using @NonNullApi, everything in the package becomes non-nullable by default, except specific cases like Optional.
I suggest you to play with nullability annotations. Starting from 24.7, we recommend to use those in org.specify.annotations, while before we had our ones in com.vaadin.hilla.
If most of your types are nullable, just use @NonNull to mark those who aren’t, i.e. List<@NonNull DTOName>.
Otherwise, mark your package as non-nullable using @NonNullApi and use @Nullable for the exceptions, i.e. @Nullable List<DTOName>.