// Path: src/main/java/com/github/opaluchlukasz/junit2spock/core/feature/Feature.java
// public abstract class Feature<T> {
//     protected abstract Optional<T> applicable(Object object);
//     protected abstract Object apply(Object object, T applicable);
// 
//     public final Object apply(Object astNode) {
//         return applicable(astNode)
//                 .map(t -> apply(astNode, t))
//                 .orElse(astNode);
//     }
// }
// 
// Path: src/main/java/com/github/opaluchlukasz/junit2spock/core/feature/FeatureProvider.java
// @Component
// public class FeatureProvider {
// 
//     private final FeatureFactory featureFactory;
// 
//     @Autowired
//     public FeatureProvider(FeatureFactory featureFactory) {
//         this.featureFactory = featureFactory;
//     }
// 
//     public List<Feature> features(Applicable applicable) {
//         return featuresTypes(applicable).stream()
//                 .map(featureFactory::provide)
//                 .collect(toList());
//     }
// }


import com.github.opaluchlukasz.junit2spock.core.feature.Feature;
import com.github.opaluchlukasz.junit2spock.core.feature.FeatureProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.List;
import static java.util.Arrays.stream;
package com.github.opaluchlukasz.junit2spock.core;




public enum Applicable {
    TEST_METHOD, FIXTURE_METHOD, REGULAR_METHOD, FIELD_FEATURE;

    @Component
    static class ApplicableInjector {
        @Autowired private FeatureProvider featureProvider;

        @PostConstruct
        public void init() {
            stream(Applicable.values()).forEach(applicable -> applicable.featureProvider = featureProvider);
        }
    }

// Path: src/main/java/com/github/opaluchlukasz/junit2spock/core/feature/Feature.java
// public abstract class Feature<T> {
//     protected abstract Optional<T> applicable(Object object);
//     protected abstract Object apply(Object object, T applicable);
// 
//     public final Object apply(Object astNode) {
//         return applicable(astNode)
//                 .map(t -> apply(astNode, t))
//                 .orElse(astNode);
//     }
// }
// 
// Path: src/main/java/com/github/opaluchlukasz/junit2spock/core/feature/FeatureProvider.java
// @Component
// public class FeatureProvider {
// 
//     private final FeatureFactory featureFactory;
// 
//     @Autowired
//     public FeatureProvider(FeatureFactory featureFactory) {
//         this.featureFactory = featureFactory;
//     }
// 
//     public List<Feature> features(Applicable applicable) {
//         return featuresTypes(applicable).stream()
//                 .map(featureFactory::provide)
//                 .collect(toList());
//     }
// }


// Path: src/main/java/com/github/opaluchlukasz/junit2spock/core/Applicable.java
import com.github.opaluchlukasz.junit2spock.core.feature.Feature;
import com.github.opaluchlukasz.junit2spock.core.feature.FeatureProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.List;
import static java.util.Arrays.stream;

package com.github.opaluchlukasz.junit2spock.core;




public enum Applicable {
    TEST_METHOD, FIXTURE_METHOD, REGULAR_METHOD, FIELD_FEATURE;

    @Component
    static class ApplicableInjector {
        @Autowired private FeatureProvider featureProvider;

        @PostConstruct
        public void init() {
            stream(Applicable.values()).forEach(applicable -> applicable.featureProvider = featureProvider);
        }
    }

    private FeatureProvider featureProvider;