### Question:
RunSingleSPARQL { public boolean addSPARQLprefix(String label,String prefix){ boolean ok = false; if(!sparqlprefix.containsKey(label)){ if(!prefix.contains("<")) sparqlprefix.put(label, "<"+prefix+">"); else sparqlprefix.put(label, prefix); if(sparqlprefix.containsKey(label)) if(sparqlprefix.get(label).contains(prefix)) ok = true; }else{ System.err.println("The prefix with "+label+" already exists. Prefix: "+sparqlprefix.get(label)); ok = false; } return ok; } RunSingleSPARQL(OWLOntology owl);  RunSingleSPARQL(OWLOntology owl, Map<String,String> prefix); Map<String,String> getSPARQLprefix(); boolean addSPARQLprefix(String label,String prefix); boolean removeSPARQLprefix(String label); QueryExecution createSPARQLQueryExecutionFactory(String query);  }### Answer:
@Test public void testAddSPARQLprefix() { String label = "mylabel"; String prefix = "<http: Map<String,String> map = new HashMap<String,String>(); map.put("rdfs","http: map.put("xsd","<http: map.put("owl","<http: map.put("rdf","<http: map.put("ex","<http: RunSingleSPARQL instance = new RunSingleSPARQL(owl,map); boolean result = instance.addSPARQLprefix(label, prefix); if(result){ Map<String, String> mymap = instance.getSPARQLprefix(); assertEquals(prefix, mymap.get(label)); }else{ fail("Some errors occur in addSPARQLprefix of KReSRunSPARQL."); } }