use of com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration in project javaparser by javaparser.
the class SubtypeOfBoundTest method recognizeProperUpperBound1.
@Test
public void recognizeProperUpperBound1() {
ResolvedTypeParameterDeclaration typeParameterDeclaration = mock(ResolvedTypeParameterDeclaration.class);
// { Integer <: α, Double <: α, α <: Object } describes two proper lower bounds and one proper upper bound for α.
InferenceVariable inferenceVariable = new InferenceVariable("α", typeParameterDeclaration);
Bound bound = new SubtypeOfBound(inferenceVariable, objectType);
assertEquals(Optional.of(new ProperUpperBound(inferenceVariable, objectType)), bound.isProperUpperBound());
}
use of com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration in project javaparser by javaparser.
the class SubtypeOfBoundTest method recognizeProperLowerBound2.
@Test
public void recognizeProperLowerBound2() {
ResolvedTypeParameterDeclaration typeParameterDeclaration = mock(ResolvedTypeParameterDeclaration.class);
// { Integer <: α, Double <: α, α <: Object } describes two proper lower bounds and one proper upper bound for α.
InferenceVariable inferenceVariable = new InferenceVariable("α", typeParameterDeclaration);
Bound bound = new SubtypeOfBound(doubleType, inferenceVariable);
assertEquals(Optional.of(new ProperLowerBound(inferenceVariable, doubleType)), bound.isProperLowerBound());
}
use of com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration in project javaparser by javaparser.
the class SubtypeOfBoundTest method recognizeProperLowerBound1.
@Test
public void recognizeProperLowerBound1() {
ResolvedTypeParameterDeclaration typeParameterDeclaration = mock(ResolvedTypeParameterDeclaration.class);
// { Integer <: α, Double <: α, α <: Object } describes two proper lower bounds and one proper upper bound for α.
InferenceVariable inferenceVariable = new InferenceVariable("α", typeParameterDeclaration);
Bound bound = new SubtypeOfBound(integerType, inferenceVariable);
assertEquals(Optional.of(new ProperLowerBound(inferenceVariable, integerType)), bound.isProperLowerBound());
}
Aggregations