I have a part of a code where "Currencies" is Enum and "Currency" is Entity:
public final Map<Currencies, Currency> currencies = new EnumMap<>(Currencies.class);
But Eclipse generates a warning:
Unsafe null type conversion (type annotations):
The value of type '@NonNull EnumMap<TestDataServiceImpl.@NonNull Currencies,Currency>'
is made accessible using the less-annotated type 'Map<TestDataServiceImpl.Currencies,Currency>',
corresponding supertype is 'Map<TestDataServiceImpl.@NonNull Currencies,Currency>'
What is the right way to handle it? Should I wrap my map with Optional? Is it mandatory? Should I ignore the warning as I know there will be no null case?