@Test
public void testGetCandidatesForReuse() throws ClassNotFoundException, NoSuchFieldException, ConstructionFailedException, NoSuchMethodException {
TestFactory testFactory = TestFactory.getInstance();
Class<?> sut = TestGenerationContext.getInstance().getClassLoaderForSUT().loadClass(FactoryExample.class.getCanonicalName());
Properties.PRIMITIVE_REUSE_PROBABILITY = 1.0;
Properties.OBJECT_REUSE_PROBABILITY = 1.0;
DefaultTestCase test = new DefaultTestCase();
GenericConstructor constructor = new GenericConstructor(sut.getConstructor(), sut);
VariableReference var1 = testFactory.addConstructor(test, constructor, 0, 0);
test.addStatement(new CharPrimitiveStatement(test,'-'));
GenericMethod method = new GenericMethod(sut.getMethod("testInt", int.class), sut);
testFactory.addMethodFor(test, var1, method, 2);
MethodStatement stmt = (MethodStatement)test.getStatement(test.size()-1);
VariableReference var = stmt.getParameterReferences().get(0);
assertNotEquals("Char should not be passed as Integer", var.getType(), char.class);
assertEquals("Incorrect test size", 4, test.size());
}
}