Source:
<code>public void testOneOf() throws Exception { final InferenceEngine inferenceEngine = mock(InferenceEngine.class); <START> final Map<Resource, Set<Resource>> enumerations = new HashMap<>(); <END> enumerations.put(SUITS, CARD_SUIT_ENUMERATION); when(inferenceEngine.isEnumeratedType(SUITS)).thenReturn(true); when(inferenceEngine.getEnumeration(SUITS)).thenReturn(CARD_SUIT_ENUMERATION); enumerations.put(RANKS, CARD_RANK_ENUMERATION); when(inferenceEngine.isEnumeratedType(RANKS)).thenReturn(true); when(inferenceEngine.getEnumeration(RANKS)).thenReturn(CARD_RANK_ENUMERATION); final Projection query = new Projection( new StatementPattern(new Var("s"), new Var("p", RDF.TYPE), new Var("o", SUITS)), new ProjectionElemList(new ProjectionElem("s", "subject"))); query.visit(new OneOfVisitor(conf, inferenceEngine)); assertTrue(query.getArg() instanceof BindingSetAssignment); final BindingSetAssignment bsa = (BindingSetAssignment) query.getArg(); final Iterable<BindingSet> iterable = bsa.getBindingSets(); final Iterator<BindingSet> iter = iterable.iterator(); assertBindingSet(iter, CARD_SUIT_ENUMERATION.iterator()); final Projection query2 = new Projection( new StatementPattern(new Var("s"), new Var("p", RDF.TYPE), new Var("o", RANKS)), new ProjectionElemList(new ProjectionElem("s", "subject"))); query2.visit(new OneOfVisitor(conf, inferenceEngine)); assertTrue(query2.getArg() instanceof BindingSetAssignment); final BindingSetAssignment bsa2 = (BindingSetAssignment) query2.getArg(); final Iterable<BindingSet> iterable2 = bsa2.getBindingSets(); final Iterator<BindingSet> iter2 = iterable2.iterator(); assertBindingSet(iter2, CARD_RANK_ENUMERATION.iterator()); }</code><technical_language>this is</technical_language>

Target:
public void testOneOf() throws Exception { final InferenceEngine inferenceEngine = mock(InferenceEngine.class); when(inferenceEngine.isEnumeratedType(SUITS)).thenReturn(true); when(inferenceEngine.getEnumeration(SUITS)).thenReturn(CARD_SUIT_ENUMERATION); when(inferenceEngine.isEnumeratedType(RANKS)).thenReturn(true); when(inferenceEngine.getEnumeration(RANKS)).thenReturn(CARD_RANK_ENUMERATION); final Projection query = new Projection( new StatementPattern(new Var("s"), new Var("p", RDF.TYPE), new Var("o", SUITS)), new ProjectionElemList(new ProjectionElem("s", "subject"))); query.visit(new OneOfVisitor(conf, inferenceEngine)); assertTrue(query.getArg() instanceof BindingSetAssignment); final BindingSetAssignment bsa = (BindingSetAssignment) query.getArg(); final Iterable<BindingSet> iterable = bsa.getBindingSets(); final Iterator<BindingSet> iter = iterable.iterator(); assertBindingSet(iter, CARD_SUIT_ENUMERATION.iterator()); final Projection query2 = new Projection( new StatementPattern(new Var("s"), new Var("p", RDF.TYPE), new Var("o", RANKS)), new ProjectionElemList(new ProjectionElem("s", "subject"))); query2.visit(new OneOfVisitor(conf, inferenceEngine)); assertTrue(query2.getArg() instanceof BindingSetAssignment); final BindingSetAssignment bsa2 = (BindingSetAssignment) query2.getArg(); final Iterable<BindingSet> iterable2 = bsa2.getBindingSets(); final Iterator<BindingSet> iter2 = iterable2.iterator(); assertBindingSet(iter2, CARD_RANK_ENUMERATION.iterator()); }