}
@SuppressWarnings({ "rawtypes", "unchecked" })
private PropertyDescriptor buildMockDescriptor(VisualControlDescriptor vcd) {
PropertyDescriptor mockDescriptor = Mockito.mock(PropertyDescriptor.class);
PropertyEditor mockEditor = Mockito.mock(PropertyEditor.class);
Mockito.when(mockDescriptor.getShortDescription()).thenReturn("mock");
Mockito.when(mockDescriptor.getVisualControlDescriptor()).thenReturn(vcd);
Mockito.when(mockDescriptor.getPropertyEditor()).thenReturn(mockEditor);
Mockito.when(mockDescriptor.isFieldMutable()).thenReturn(true);
// Change the result of get() method, to trigger refresh
Mockito.when(mockEditor.getTags()).thenReturn(Arrays.asList("mock", "other"));
Mockito.when(mockEditor.getAsText()).thenReturn("mock");
Mockito.when(mockEditor.getValue()).thenReturn(vcd != VisualControlDescriptor.CheckBox ? "mock" : Boolean.TRUE);
return mockDescriptor;
}