A convenient way to set new-style options in tests.

Testing Done:
CI passed.

Merged this into a branch where I switched a bunch of JvmTask-related tests over to new options, and checked that this worked.

Reviewed at https://rbcommons.com/s/twitter/r/1163/
Sync of https://github.com/pantsbuild/pants/commit/9d14ae486b8eeba0449c697c7adc975979a06b28