VisitorTest has some code smells regarding Optional usage.
Optional<String> has been used as class field type.
Optional<String> has been used as parameter type.
Optional is primarily intended for use as a method return type where there is a clear need to represent "no result," and where using null is likely to cause errors. A variable whose type is Optional should never itself be null; it should always point to an Optional instance.
Description
VisitorTest
has some code smells regardingOptional
usage.Optional<String>
has been used as class field type.Optional<String>
has been used as parameter type.Optional
is primarily intended for use as a method return type where there is a clear need to represent "no result," and where usingnull
is likely to cause errors. A variable whose type isOptional
should never itself be null; it should always point to anOptional
instance.Acceptance Criteria