The factorization method for systems with a complex action. A test in Random Matrix Theory for finite density QCD