Code example for TreeSet

Methods: iterator

0
	final AutoSPARQLSession session = new AutoSPARQLSession();
 
	//@Test 
	public void testFillExamples() 
	{ 
		SortedSet<Example> examples = new TreeSet<Example>(Arrays.asList(new Example[] {new Example("http://dbpedia.org/resource/Leipzig")}));
		session.fillExamples(examples);
		System.out.println(examples);
		assertTrue(examples.iterator().next().get("http://dbpedia.org/ontology/postalCode").equals("04001-04357@en"));
		//System.out.println(examples.getFirst()); 
	} 
 
	@Test 
	public void testGetExamples() 
	{ 
		//System.out.println(session.getExamples("European Union countries")); 
		session.setFastSearch(true);
		SortedSet<Example> examples = session.getExamples("Books written by Dan Brown");				
		Example example = new Example("http://dbpedia.org/resource/Digital_Fortress");
		assertTrue("Example "+example+" missing in results. Found values: "+'\n'+
				Example.getURIs(examples).toString().replace(',', '\n'),examples.contains(example));