private static String getRangedItem(Integer startOfRange, Integer endOfRange) {

    String separator = (endOfRange - startOfRange) > 1 ? "-" : ",";

    String rangeItem = endOfRange.equals(startOfRange) ?
        endOfRange.toString() :
        startOfRange + separator + endOfRange;
    return rangeItem;
  }
Splits a range to its explicit set of values.
<p/>
For example if the range is "1-5", the result will be [1, 2, 3, 4, 5]

@param range the range to split
@return a set of integers representing the original range
ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java