code: public static <T> T unitMap(Function<Map<String, List<Unit>>, T> function) {
          readWriteLock.readLock().lock();
          try {
              return function.apply(Collections.unmodifiableMap(unitMap));
          } finally {
              readWriteLock.readLock().unlock();
          }
      }
docs: Iterate the  {@link #unitMap local unit map}  thread-safely.
  This iteration is for you to read the map, not to modify the map.
  
  @param function the function whatever you want to do with the unit map.