try {
preferences.setValue(
PreferencesValidatorImpl.CHECK_VALIDATOR_COUNT,
"true");
// Call store() method to invoke the validator.
preferences.store();
result.setReturnCode(TestResult.PASSED);
} catch (ReadOnlyException ex) {
TestUtils.failOnException("Unable to set preference value.", ex, result);
} catch (IOException ex) {
TestUtils.failOnException("Unable to store preference value.", ex, result);