code: public <T> T getItem(final List<T> items, final int probability, final T defaultItem) {
      if (items == null) {
        throw new IllegalArgumentException("Item list cannot be null");
      }
      if (items.isEmpty()) {
        throw new IllegalArgumentException("Item list cannot be empty");
      }
  
      return chance(probability) ? items.get(random.nextInt(items.size())) : defaultItem;
    }
docs: Returns a random item from a list of items or the defaultItem depending on the probability parameter. The
  probability determines the chance (in %) of returning an item off the list versus the default value.
  
  @param <T> Item type in the list and to return
  @param items List of items to choose from
  @param probability chance (in %, 100 being guaranteed) of returning an item from the list
  @param defaultItem value to return if the probability test fails
  @return Item from the list or the default value