@SuppressWarnings("unchecked")
 public <T extends Distribution> T toDistribution(String value, Class<T> clazz) {
   StringTokenizer st = new StringTokenizer(value, ", \t\f");
   if (!st.hasMoreTokens()) throw new DistributionFormatException("Missing ditribution type");
   String type = st.nextToken();
   ObjectMap<String, Adapter<?>> categories = typeMap.get(clazz);
   Adapter<T> converter = (Adapter<T>) categories.get(type);
   if (converter == null)
     throw new DistributionFormatException(
         "Cannot create a '" + clazz.getSimpleName() + "' of type '" + type + "'");
   String[] args = new String[st.countTokens()];
   for (int i = 0; i < args.length; i++) args[i] = st.nextToken();
   return converter.toDistribution(args);
 }