1 package com.beust.jcommander; 2 3 import java.util.SortedSet; 4 import java.util.TreeSet; 5 6 public class SetConverter implements IStringConverter<SortedSet<Integer>> { 7 convert(String value)8 public SortedSet<Integer> convert(String value) { 9 SortedSet<Integer> set = new TreeSet<Integer>(); 10 String[] values = value.split(","); 11 for (String num : values) { 12 set.add(Integer.parseInt(num)); 13 } 14 return set; 15 } 16 } 17