code: private static <T> List<T> unmodifiableList(List<T> list) {
          if (list == null) {
              return Collections.emptyList();
          }
          return Collections.unmodifiableList(list);
      }
docs: Gets an unmodifiable list from the given list.
  
  @param list the list, might be {@code null}.
  @return an unmodifiable list, never {@code null}.