package org.eluder.juniter.core;

import org.eluder.juniter.core.runner.BasicRunner;
import org.eluder.juniter.core.runner.Runner;
import org.eluder.juniter.core.util.ReflectionUtils;
import org.junit.runner.Description;
import org.junit.runner.manipulation.Filter;
import org.junit.runner.manipulation.Filterable;
import org.junit.runner.manipulation.NoTestsRemainException;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.model.InitializationError;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestRunner extends org.junit.runner.Runner implements Filterable {

    private static final Logger log = LoggerFactory.getLogger(TestRunner.class);

    private final Runner runner;

    public TestRunner(final Class<?> klass) throws InitializationError {
        TestContext context = klass.getAnnotation(TestContext.class);
        runner = createRunner(context);
        if (runner == null) {
            throw new InitializationError("Runner not created properly");
        } else {
            log.debug("Test runner initialized with {}", runner.getClass().getName());
        }
        runner.init(klass);
    }

    @Override
    public final Description getDescription() {
        return runner.getDescription();
    }

    @Override
    public final void run(final RunNotifier notifier) {
        runner.run(notifier);
    }

    @Override
    public final void filter(final Filter filter) throws NoTestsRemainException {
        runner.filter(filter);
    }

    protected Runner createRunner(final TestContext context) throws InitializationError {
        if (context == null) {
            return new BasicRunner();
        } else {
            return ReflectionUtils.instantiate(context.runner());
        }
    }
}

@@ -365,24 +365,116 @@
 nException;%0A
+import org.junit.runner.manipulation.Sortable;%0Aimport org.junit.runner.manipulation.Sorter;%0A
 import org.j
@@ -698,16 +698,26 @@
 lterable
+, Sortable
  %7B%0A%0A    
@@ -1610,24 +1610,118 @@
 er);%0A    %7D%0A%0A
+    @Override%0A    public void sort(final Sorter sorter) %7B%0A        runner.sort(sorter);%0A    %7D%0A%0A
     protecte

Allow sorting through delegate.