// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/project/MavenAndroidProject.java
// public interface MavenAndroidProject {
// 
//     public String getName();
// 
//     public String getGroup();
// 
//     public String getVersion();
// 
//     public boolean isAndroidProject();
// 
//     public boolean isLibrary();
// 
//     public List<Dependency> getNonRuntimeDependencies();
// 
//     public List<Dependency> getLibraryDependencies();
// 
//     public File getAssetsDirectory();
// 
//     public File getResourceFolder();
// 
//     public File getAndroidManifestFile();
//     
//     public File getDestinationManifestFile();
// 
//     public List<String> getPlatformProvidedDependencies();
// 
//     public List<String> getSourcePaths();
//     
//     public String getOutputDirectory();
// 
//     public boolean isIgnoreOptionalWarningsInGenFolder();
// 
//     public List<String> getTestSourcePaths();
// 
//     public List<String> getResourcePaths();
// 
//     public List<String> getTestResourcePaths();
// 
// }


import java.util.List;
import me.gladwell.eclipse.m2e.android.project.MavenAndroidProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IClasspathEntry;
    GEN(2) {
        @Override
        protected boolean matches(MavenAndroidProject project, IClasspathEntry entry) {
            IPath segment = entry.getPath().removeFirstSegments(1);
            return segment.toString().equals("gen");
        }
    },
    TEST_JAVA(3) {
        @Override
        protected boolean matches(MavenAndroidProject project, IClasspathEntry entry) {
            IPath segment = entry.getPath().removeFirstSegments(1);
            return contains(project.getTestSourcePaths(), segment);
        }
    },
    TEST_RESOURCES(4) {
        @Override
        protected boolean matches(MavenAndroidProject project, IClasspathEntry entry) {
            IPath segment = entry.getPath().removeFirstSegments(1);
            return contains(project.getTestResourcePaths(), segment);
        }
    };

    int priority;

    SourceType(int priority) {
        this.priority = priority;
    }

    protected abstract boolean matches(MavenAndroidProject project, IClasspathEntry entry);

// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/project/MavenAndroidProject.java
// public interface MavenAndroidProject {
// 
//     public String getName();
// 
//     public String getGroup();
// 
//     public String getVersion();
// 
//     public boolean isAndroidProject();
// 
//     public boolean isLibrary();
// 
//     public List<Dependency> getNonRuntimeDependencies();
// 
//     public List<Dependency> getLibraryDependencies();
// 
//     public File getAssetsDirectory();
// 
//     public File getResourceFolder();
// 
//     public File getAndroidManifestFile();
//     
//     public File getDestinationManifestFile();
// 
//     public List<String> getPlatformProvidedDependencies();
// 
//     public List<String> getSourcePaths();
//     
//     public String getOutputDirectory();
// 
//     public boolean isIgnoreOptionalWarningsInGenFolder();
// 
//     public List<String> getTestSourcePaths();
// 
//     public List<String> getResourcePaths();
// 
//     public List<String> getTestResourcePaths();
// 
// }


// Path: me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/configuration/SourceType.java
import java.util.List;
import me.gladwell.eclipse.m2e.android.project.MavenAndroidProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IClasspathEntry;

    GEN(2) {
        @Override
        protected boolean matches(MavenAndroidProject project, IClasspathEntry entry) {
            IPath segment = entry.getPath().removeFirstSegments(1);
            return segment.toString().equals("gen");
        }
    },
    TEST_JAVA(3) {
        @Override
        protected boolean matches(MavenAndroidProject project, IClasspathEntry entry) {
            IPath segment = entry.getPath().removeFirstSegments(1);
            return contains(project.getTestSourcePaths(), segment);
        }
    },
    TEST_RESOURCES(4) {
        @Override
        protected boolean matches(MavenAndroidProject project, IClasspathEntry entry) {
            IPath segment = entry.getPath().removeFirstSegments(1);
            return contains(project.getTestResourcePaths(), segment);
        }
    };

    int priority;

    SourceType(int priority) {
        this.priority = priority;
    }

    protected abstract boolean matches(MavenAndroidProject project, IClasspathEntry entry);

    public static SourceType forPathIn(MavenAndroidProject project, IClasspathEntry entry) {