+ @Override
+ public void remove() throws IllegalStateException {
+ checkState(!isRoot(), "can not remove root album");
+ removeAllAlbums();
+ removeAllImages();
+ parent.albums.remove(this);
+ }
+
+ private void removeAllImages() {
+ for (Image image : images.values()) {
+ image.remove();
+ }
+ }
+
+ private void removeAllAlbums() {
+ for (Album album: albums) {
+ album.remove();
+ }
+ }
+