REVIEW-3385: Correctly handle duplicate dependency management elements. Additional unit test coverage.