code: public static ScorecardModel make(final String name, final double initialScore, RuleTable[] rules) {
      // Get the list of features
      String[] colNames = new String[rules.length];
      for( int i=0; i<rules.length; i++ )
        colNames[i] = rules[i]._name;
  
      // javassist support for rewriting class files
      ClassPool _pool = ClassPool.getDefault();
      try {
        // Make a javassist class in the java hierarchy
        String cname = uniqueClassName(name);
        CtClass scClass = _pool.makeClass(cname);
        CtClass baseClass = _pool.get("water.score.ScorecardModel"); // Full Name Lookup
        scClass.setSuperclass(baseClass);
        // Produce the scoring method(s)
        ScorecardModel scm = new ScorecardModel(name, colNames,initialScore, rules);
        scm.makeScoreHashMethod(scClass);
        scm.makeScoreAryMethod(scClass);
        // Produce a 1-arg constructor
        String cons = "  public "+cname+"(water.score.ScorecardModel base) { super(base); }";
        CtConstructor happyConst = CtNewConstructor.make(cons,scClass);
        scClass.addConstructor(happyConst);
  
        Class myClass = scClass.toClass(ScorecardModel.class.getClassLoader(), null);
        Constructor<ScorecardModel> co = myClass.getConstructor(ScorecardModel.class);
        ScorecardModel jitted_scm = co.newInstance(scm);
        return jitted_scm;
  
      } catch( Exception e ) {
        Log.err(Sys.SCORM,"Javassist failed",e);
      }
      return null;
    }
docs: Scorecard model builder: JIT a subclass with the fast version wired in to
  'score(row)'