### Question:
ConstructorAnalysis { static AnalysisResult analyse( Class<?> klass, Constructor<?> constructor) throws IOException { Class<?>[] parameterTypes = constructor.getParameterTypes(); InputStream in = klass.getResourceAsStream("/" + klass.getName().replace('.', '/') + ".class"); if (in == null) { throw new IllegalArgumentException(format("can not find bytecode for %s", klass)); } return analyse(in, klass.getName().replace('.', '/'), klass.getSuperclass().getName().replace('.', '/'), parameterTypes); }    }### Answer:
@Test public void regression1() throws IOException { InputStream classInputStream = this.getClass().getResourceAsStream("example_scala_class01.bin"); assertNotNull(classInputStream); Map<String, FormalParameter> assignements = analyse(classInputStream, "com/kaching/trading/rules/formula/FormulaValue", "java/lang/Object", int.class).assignments; assertMapEqualAsString(ImmutableMap.of("number", "p0"), assignements); }
@Test public void regression2() throws IOException { InputStream classInputStream = this.getClass().getResourceAsStream("example_scala_class02.bin"); assertNotNull(classInputStream); Map<String, FormalParameter> assignements = analyse(classInputStream, "com/kaching/user/GetAllModels", "com/kaching/platform/queryengine/AbstractQuery", Boolean.class).assignments; assertMapEqualAsString(ImmutableMap.of("com$kaching$user$GetAllModels$$withHistory", "p0"), assignements); }