code: public void markUsedElements(CodeReferenceMap publicRootSet) {
      if (publicRootSet == null) {
        markUsedElements();
        return;
      }
      //Add all public methods in publicRootClasses to root set
      for (String clazz : publicRootSet.getReferencedClasses()) {
        ClassReferenceNode classNode = (ClassReferenceNode) elementReferenceMap
            .get(ElementReferenceMapper.stitchClassIdentifier(clazz));
        assert(classNode != null);
        Iterable<ExecutableElement> methods = ElementUtil.getMethods(classNode.classElement);
        for (ExecutableElement method : methods) {
          if (ElementUtil.isPublic(method)) {
            rootSet.add(ElementReferenceMapper.stitchMethodIdentifier(method, env.typeUtil(),
                env.elementUtil()));
          }
        }
      }
  
      //Add input root methods to static set
      for (Table.Cell<String, String, ImmutableSet<String>> cell : publicRootSet
          .getReferencedMethods().cellSet()) {
        String clazzName  = cell.getRowKey();
        String methodName  = cell.getColumnKey();
        for (String signature : cell.getValue()) {
          rootSet.add(ElementReferenceMapper
              .stitchMethodIdentifier(clazzName, methodName, signature));
        }
      }
  
      markUsedElements(staticSet);
      markUsedElements(rootSet);
    }
docs: the isPublic check.