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