1   package com.lexicalscope.fluentreflection;
2   
3   import static com.lexicalscope.fluentreflection.ReflectionMatchers.hasNoSuperclasses;
4   import static org.hamcrest.Matchers.equalTo;
5   
6   import org.hamcrest.Matcher;
7   
8   import com.lexicalscope.fluentreflection.FluentClass;
9   import com.lexicalscope.fluentreflection.ReflectionMatcher;
10  
11  public class TestMatcherTypeHasNoSuperclasses extends AbstractTestReflectionMatcher<FluentClass<?>> {
12      class Superclass {
13  
14      }
15  
16      @Override
17      protected FluentClass<?> target() {
18          return type;
19      }
20  
21      @Override
22      protected ReflectionMatcher<FluentClass<?>> matcher() {
23          return hasNoSuperclasses();
24      }
25  
26      @Override
27      protected void setupMatchingCase() {
28          whenTypeHasNoSuperclass();
29      }
30  
31      @Override
32      protected void setupFailingCase() {
33          whenTypeHasSuperclass(Superclass.class);
34      }
35  
36      @Override
37      protected Matcher<String> hasDescription() {
38          return equalTo("type that extends no superclasses");
39      }
40  }