Code example for DefaultConversionService

0
	DefaultConversionService conversionService;
 
	@Before 
	public void setUp() { 
 
		this.conversionService = new DefaultConversionService();
		QueryExecutionConverters.registerConvertersIn(conversionService);
	} 
 
	/** 
	 * @see DATACMNS-483 
	 */ 
	@Test
	@SuppressWarnings("unchecked") 
	public void turnsNullIntoGuavaOptional() { 
 
		Optional<Object> optional = conversionService.convert(new NullableWrapper(null), Optional.class);
		assertThat(optional, is(Optional.<Object> absent()));
	} 
 
Contextual code suggestions in your IDE  Get Codota for Java