Consider this use of AutoBuilder:
@AutoBuilder(callMethod = "of")
public abstract static class Builder<T> {
@Override
public abstract Builder<T> setValue(T value);
...
}
(distilled from apache/beam#34902 but I will likely have changed it with a workaround by the time you click)
The type parameter T can legitimately be instantiated with any nullability: @NonNull String, @Nullable String, etc. But the generated builder class throws NullPointerException in response to setValue(null). Instead, the builder class should be fully agnostic as to the nullability (or other qualifiers) for type T.