Class FeatureUtil


  • @GwtIncompatible
    public class FeatureUtil
    extends Object
    Utilities for collecting and validating tester requirements from annotations.
    Author:
    George van den Driessche
    • Method Detail

      • addImpliedFeatures

        @CanIgnoreReturnValue
        public static Set<Feature<?>> addImpliedFeatures​(Set<Feature<?>> features)
        Given a set of features, add to it all the features directly or indirectly implied by any of them, and return it.
        Parameters:
        features - the set of features to expand
        Returns:
        the same set of features, expanded with all implied features
      • impliedFeatures

        public static Set<Feature<?>> impliedFeatures​(Set<Feature<?>> features)
        Given a set of features, return a new set of all features directly or indirectly implied by any of them.
        Parameters:
        features - the set of features whose implications to find
        Returns:
        the implied set of features
      • getTesterAnnotations

        public static Iterable<AnnotationgetTesterAnnotations​(AnnotatedElement classOrMethod)
        Find all the tester annotations declared on a tester class or method.
        Parameters:
        classOrMethod - a class or method whose tester annotations to find
        Returns:
        an iterable sequence of tester annotations on the class
      • intersection

        public static <T> Set<T> intersection​(Set<? extends T> set1,
                                              Set<? extends T> set2)
        Construct a new Set that is the intersection of the given sets.