code: public static int toExtensions(String extensions) {
          int result = 0;
          for ( String ext : Splitter.on(',').trimResults().omitEmptyStrings().split(extensions) ) {
              try {
                  Field f = Extensions.class.getField(ext.replace('-', '_').toUpperCase());
                  result |= (int)f.get(null);
              }
              catch ( NoSuchFieldException e ) {
                  throw new IllegalArgumentException("No such extension: " + ext);
              }
              catch ( IllegalAccessException e ) {
                  throw new IllegalArgumentException("Cannot read int value for extension " + ext + ": " + e, e);
              }
          }
          return result;
      }
docs: Convert a comma separated list of extension names to an int. Each name is
  converted to upper case, any '-' is replaced by '_'. The result is expected to
  be a flag from {@link Extensions}.
  
  @param extensions    A comma separated list of PegDown extensions.
  
  @return An `int` representing the enabled Pegdown extensions.