Added support for multiple redirects. Updated tests to use JUnit