Refactor asObject tests to use ComplexObjectSpecifier.