use of com.github.javaparser.symbolsolver.resolution.typeinference.Instantiation in project javaparser by javaparser.
the class SameAsBoundTest method recognizeInstantiation.
@Test
public void recognizeInstantiation() {
// { α = String } contains a single bound, instantiating α as String.
InferenceVariable inferenceVariable = new InferenceVariable("α", null);
Bound bound1 = new SameAsBound(inferenceVariable, stringType);
Bound bound2 = new SameAsBound(stringType, inferenceVariable);
assertEquals(Optional.of(new Instantiation(inferenceVariable, stringType)), bound1.isAnInstantiation());
assertEquals(Optional.of(new Instantiation(inferenceVariable, stringType)), bound2.isAnInstantiation());
}
Aggregations