public void setWorkingWeeks ( final Map < String , WorkingWeek > workingWeeks ) { final Map < String , WorkingWeek > ww = new HashMap <> ( ) ; ww . putAll ( workingWeeks ) ; this . workingWeeks = ww ; }
Will take a copy of a non null map but doing so by replacing the internal one in one go for consistency .