code: public static Integer[] getIntArray(String elements) {
          if (elements == null || elements.isEmpty()) {
              return new Integer[0];
          }
  
          List<Integer> values = new ArrayList<>();
          int index;
          int start, end;
          for (String element : elements.split(",")) {
              element = element.trim();
              index = element.indexOf('-');
              try {
                  if (index != -1) {
                      start = Integer.parseInt(element.substring(0, index).trim());
                      end = Integer.parseInt(element.substring(index + 1).trim());
                      if (end == start) {
                          values.add(start);
                      } else if (end > start) {
                          for (index = start; index <= end; index++) {
                              values.add(index);
                          }
                      } else {
                          for (index = start; index >= end; index--) {
                              values.add(index);
                          }
                      }
                  } else {
                      values.add(Integer.parseInt(element));
                  }
              } catch (NumberFormatException ex) {
                  ex.printStackTrace();
              }
          }
          return values.toArray(new Integer[0]);
      }
docs: Converts a String expression of elements into an integer array<br> For example: "12-34, 35, 36, 11-0"
  
  @param elements to convert
  @return the converted result