ServiceReference[] refs = context.getServiceReferences( DictionaryService.class.getName(), "(Language=*)" );
if ( refs != null )
{
// First, get a dictionary service and then check if the word is correct.
DictionaryService dictionary = ( DictionaryService ) context.getService( refs[0] );
assertTrue( "welcome definition presence", dictionary.checkWord( "welcome" ) );
assertFalse( "blah definition absense", dictionary.checkWord( "blah" ) );
// Unget the dictionary service.
context.ungetService( refs[0] );
}
else