private void test(Class<?> clazz, String methodName, int expectedParamsCount) throws Exception {
		InvocationChainRetriever retriever = new InvocationChainRetriever();
		
		
		String className = clazz.getName();
		InputStream in = this.getClass().getResourceAsStream("/" + className.replace('.', '/') + ".class");
		ClassFile cf = new ClassFile(new DataInputStream(in));
		for (Object m : cf.getMethods()) {
			MethodInfo minfo = (MethodInfo)m;
			CodeAttribute ca = minfo.getCodeAttribute();
			if (!"test".equals(minfo.getName())) {
				continue;
			}
		
			CodeIterator ci = ca.iterator();
			
	        ConstPool pool = cf.getConstPool();
			
			while(ci.hasNext()) {
				int index = ci.next();
				int op = ci.byteAt(index);
				if (!retriever.isInvoke(op)) {
					continue;
				}
				if (!methodName.equals(InvocationChainRetriever.getMethodName(cf, ci, index, op))) {
					continue;
				}
		        int methodAddress = ci.s16bitAt(index + 1);
		        String methodRefType = pool.getMethodrefType(methodAddress);
				int paramCount = retriever.getMethodParamCount(methodRefType);
				Assert.assertEquals(expectedParamsCount, paramCount);
				return;
			}
		}
		Assert.fail("Method " + methodName + " is not found in samples class " + clazz);
	}