code: @SuppressWarnings("unchecked")
      public static <T> Set<T> getTableValue(final Table table) {
          final Object value = table.getValue();
          Set<T> idsReturn;
          if (value == null) {
              idsReturn = Collections.emptySet();
          } else if (value instanceof Collection) {
              final Collection<T> ids = (Collection<T>) value;
              idsReturn = ids.stream().filter(Objects::nonNull).collect(Collectors.toSet());
          } else {
              final T id = (T) value;
              idsReturn = Collections.singleton(id);
          }
          return idsReturn;
      }
docs: Gets the selected item id or in multiselect mode the selected ids.
  
  @param table
  the table to retrieve the selected ID(s)
  @return the ID(s) which are selected in the table