code: protected Collection<WriteLock> getWriteLocks() {
  
          final Collection<WriteLock> writeLocks = new TreeSet<>((o1,
                  o2) -> Integer.compare(o2.getHoldCount(), o1.getHoldCount()));
  
          for (final AbstractHtml ownerTag : ownerTags) {
              final WriteLock writeLock = ownerTag.getSharedObject()
                      .getLock(ACCESS_OBJECT).writeLock();
              if (writeLock != null) {
                  try {
                      writeLocks.add(writeLock);
                  } catch (final Exception e) {
                      e.printStackTrace();
                  }
              }
          }
  
          return writeLocks;
      }
docs: NB: this may not return the same locks as there could be the its
  ownerTags change. So call only once and reuse it for both lock and unlock
  call.
  
  @return the set of write locks