@Test
public void testApply() {

	DefaultDDMExpressionObserver defaultDDMExpressionObserver =
		new DefaultDDMExpressionObserver();
	DefaultDDMExpressionObserver spy = spy(defaultDDMExpressionObserver);
	SetInvalidFunction setInvalidFunction = new SetInvalidFunction();
	setInvalidFunction.setDDMExpressionObserver(spy);
	Boolean result = setInvalidFunction.apply(
		"contact", "Custom error message");
	ArgumentCaptor<UpdateFieldPropertyRequest> argumentCaptor =
		ArgumentCaptor.forClass(UpdateFieldPropertyRequest.class);
	Mockito.verify(
		spy, Mockito.times(1)
	).updateFieldProperty(
		argumentCaptor.capture()
	);
	UpdateFieldPropertyRequest updateFieldPropertyRequest =
		argumentCaptor.getValue();
	Map<String, Object> properties =
		updateFieldPropertyRequest.getProperties();
	Assert.assertEquals("contact", updateFieldPropertyRequest.getField());
	Assert.assertTrue("valid", properties.containsKey("valid"));
	Assert.assertEquals(
		"Custom error message",
		updateFieldPropertyRequest.getPropertyOptional(
			"errorMessage"
		).get());
	Assert.assertEquals(false, properties.get("valid"));
	Assert.assertTrue(result);
}