TST: Add test to verify optimizing example from documentation works

Closes #96