### Question:
SwitchOnFailureParametersOperator implements ParametersOperator { @Override public void updateParameters(Parameters parameters) { try { first.updateParameters(parameters); } catch (Exception e) { second.updateParameters(parameters); } } SwitchOnFailureParametersOperator(ParametersOperator first,
                                             ParametersOperator second); @Override void updateParameters(Parameters parameters);  }### Answer:
@Test public void firstSucceeds() throws Exception { testee.updateParameters(parameters); verify(first).updateParameters(parameters); verifyZeroInteractions(second); }
@Test public void firstFails() throws Exception { doThrow(new RuntimeException()) .when(first) .updateParameters(parameters); testee.updateParameters(parameters); verify(second).updateParameters(parameters); }