code: private void removeObsoleteElements(List<String> names,
                                          Map<String, View> sharedElements,
                                          List<String> elementsToRemove) {
          if (elementsToRemove.size() > 0) {
              names.removeAll(elementsToRemove);
              for (String elementToRemove : elementsToRemove) {
                  sharedElements.remove(elementToRemove);
              }
          }
      }
docs: Removes obsolete elements from names and shared elements.
  
  @param names            Shared element names.
  @param sharedElements   Shared elements.
  @param elementsToRemove The elements that should be removed.