void muteOthers ( AddOnModel addOnModel ) { Set < AddOnModel > toMute = nonPermanent . entrySet ( ) . stream ( ) . filter ( entry -> ! entry . getKey ( ) . equals ( addOnModel ) ) . flatMap ( entry -> entry . getValue ( ) . stream ( ) ) . map ( Reference :: get ) . filter ( Objects :: nonNull ) . peek ( izouSoundLineBaseClass -> izouSoundLineBaseClass . setMutedFromSystem ( true ) ) . map ( IzouSoundLine :: getAddOnModel ) . collect ( Collectors . toSet ( ) ) ; if ( permanentAddOn != null && ! permanentAddOn . equals ( addOnModel ) && permanentLines != null ) { toMute . add ( addOnModel ) ; permanentLines . stream ( ) . map ( Reference :: get ) . filter ( Objects :: nonNull ) . forEach ( izouSoundLineBaseClass -> izouSoundLineBaseClass . setMutedFromSystem ( true ) ) ; } toMute . forEach ( this :: mute ) ; List < WeakReference < IzouSoundLineBaseClass > > weakReferences = nonPermanent . get ( addOnModel ) ; if ( weakReferences != null ) { weakReferences . stream ( ) . map ( Reference :: get ) . filter ( Objects :: nonNull ) . forEach ( izouSoundLine -> izouSoundLine . setMutedFromSystem ( false ) ) ; } }
mutes the other Addons