How to merge two unmodifiable static final sets?
public static final Set<Long> ORG_SUBSCRIBER_ALLOWED_NUMBER_CD = Set.of(COMPANY_GST, GOVERNMENT_BODY_GST);
public static final Set<Long> INDIVIDUAL_SUBSCRIBER_ALLOWED_NUMBER_CD = Set.of(BUSINESS_PAN, INDIVIDUAL_PAN);
I want to combine the above static final sets into one set (one-statement initialization), because it's a Class variable
public static final Set<Long> SUBSCRIBER_ALLOWED_NUMBER_CD = ?
A one-statement initialization, if preferred:
Or, perhaps more readable:
Ignore the
Collections.unmodifiableSetcall if the third set is not expected to be unmodifiable.