question: public void removeAll ( ) { List < Layer > oldLayers = getLayerList ( ) ; if ( allLayers == null || allLayers . isEmpty ( ) ) { return ; } BeanContext bc = getBeanContext ( ) ; List < Layer > nonRemoveableLayers = new ArrayList < Layer > ( ) ; for ( Layer layer : oldLayers ) { if ( layer != null ) { if ( layer . isRemovable ( ) ) { turnLayerOn ( false , layer ) ; layer . clearListeners ( ) ; if ( bc != null ) { bc . remove ( layer ) ; } } else { nonRemoveableLayers . add ( layer ) ; } } } setLayerList ( nonRemoveableLayers ) ; System . gc ( ) ; }
target:  Remove all the layers (that are marked as removable).