public void setCurrenciesSubjectToCrossCcyForT1 ( final Map < String , Set < String > > currenciesSubjectToCrossCcyForT1 ) { final Map < String , Set < String > > copy = new HashMap <> ( ) ; if ( currenciesSubjectToCrossCcyForT1 != null ) { copy . putAll ( currenciesSubjectToCrossCcyForT1 ) ; } this . currenciesSubjectToCrossCcyForT1 = copy ; }
Will take a copy of a non null set but doing so by replacing the internal one in one go for consistency .