// Path: src/main/java/com/nikhaldimann/viewselector/checker/ClassChecker.java
// public class ClassChecker implements ViewTraversalChecker {
// 
//     private final Selector selector;
//     private final MatchPredicate matchPredicate;
// 
//     public ClassChecker(Selector selector, View root) {
//         this.selector = selector;
// 
//         final String className = selector.getTagName();
//         if (className.equals(Selector.UNIVERSAL_TAG)) {
//             matchPredicate = MatchPredicates.ALWAYS_TRUE_PREDICATE;
//         } else {
//             matchPredicate = new MatchPredicate() {
//                 public boolean matches(View view) {
//                     return className.equals(view.getClass().getSimpleName());
//                 }
//             };
//         }
//     }
// 
//     public ViewSelection check(Set<View> views) {
//         ViewSelection result = new ViewSelection();
//         for (View view : views) {
//             switch (selector.getCombinator()) {
//                 case DESCENDANT:
//                     checkDescendantsRecursively(view, result);
//                     break;
//                 case CHILD:
//                     if (!(view instanceof ViewGroup)) {
//                         continue;
//                     }
//                     checkChildren((ViewGroup) view, result);
//                     break;
//                 case ADJACENT_SIBLING:
//                     checkSiblings(view, result, true);
//                     break;
//                 case GENERAL_SIBLING:
//                     checkSiblings(view, result, false);
//                     break;
//                 default:
//                     throw new UnsupportedOperationException(
//                             "Unsupported combinator " + selector.getCombinator());
//             }
// 
//         }
//         return result;
//     }
// 
//     private void checkDescendantsRecursively(View view, Set<View> result) {
//         // Note: Using recursion. We hope that real-world layouts don't get deep
//         // enough that this causes a problem.
//         if (matchesView(view)) {
//             result.add(view);
//         }
//         if (view instanceof ViewGroup) {
//             ViewGroup group = (ViewGroup) view;
//             for (int i = 0; i < group.getChildCount(); i++) {
//                 View childView = group.getChildAt(i);
//                 checkDescendantsRecursively(childView, result);
//             }
//         }
//     }
// 
//     private void checkChildren(ViewGroup group, Set<View> result) {
//         for (int i = 0; i < group.getChildCount(); i++) {
//             View childView = group.getChildAt(i);
//             if (matchesView(childView)) {
//                 result.add(childView);
//             }
//         }
//     }
// 
//     private void checkSiblings(View view, Set<View> result, boolean isAdjacent) {
//         ViewParent parent = view.getParent();
//         if (!(parent instanceof ViewGroup)) {
//             return;
//         }
//         ViewGroup parentGroup = (ViewGroup) parent;
// 
//         int childPos = 0;
//         while (parentGroup.getChildAt(childPos) != view) {
//             childPos++;
//         }
// 
//         if (isAdjacent && parentGroup.getChildCount() > childPos + 1) {
//             View sibling = parentGroup.getChildAt(childPos + 1);
//             if (matchesView(sibling)) {
//                 result.add(sibling);
//             }
//         } else {
//             for (int i = childPos + 1; parentGroup.getChildCount() > i; i++) {
//                 View sibling = parentGroup.getChildAt(i);
//                 if (matchesView(sibling)) {
//                     result.add(sibling);
//                 }
//             }
//         }
//     }
// 
//     private boolean matchesView(View view) {
//         return matchPredicate.matches(view);
//     }
// }
// 
// Path: src/main/java/com/nikhaldimann/viewselector/selection/ViewSelection.java
// public class ViewSelection extends LinkedHashSet<View> {
// 
// }
// 
// Path: src/test-lib/src/com/nikhaldimann/viewselector/test/util/ViewSelectorAndroidTestCase.java
// public abstract class ViewSelectorAndroidTestCase extends AndroidTestCase {
// 
//     protected ViewFactory viewFactory;
// 
//     @Before
//     public void setUp() throws Exception {
//         super.setUp();
//         viewFactory = createViewFactory();
//     }
// 
//     /**
//      * @return the factory to be used for creating views in this test
//      */
//     protected abstract ViewFactory createViewFactory();
// 
//     /**
//      * Reimplementation of Android's MoreAsserts.assertContentsInOrder() because we
//      * can't use MoreAsserts in Robolectric 1.2.
//      */
//     public static void assertContentsInOrder(Iterable<?> actual, Object... expected) {
//         ArrayList<Object> actualList = new ArrayList<Object>();
//         for (Object o : actual) {
//             actualList.add(o);
//         }
//         assertEquals(Arrays.asList(expected), actualList);
//     }
// }


import org.junit.Test;
import se.fishtank.css.selectors.Selector;
import se.fishtank.css.selectors.Selector.Combinator;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.nikhaldimann.viewselector.checker.ClassChecker;
import com.nikhaldimann.viewselector.selection.ViewSelection;
import com.nikhaldimann.viewselector.test.util.ViewSelectorAndroidTestCase;
package com.nikhaldimann.viewselector.test.abstrakt.checker;




public abstract class AbstractClassCheckerTest extends ViewSelectorAndroidTestCase {

    private Iterable<View> check(String selectorTag, Combinator combinator, View view) {
        Selector selector = new Selector(selectorTag, combinator);
        ClassChecker checker = new ClassChecker(selector, view);
// Path: src/main/java/com/nikhaldimann/viewselector/checker/ClassChecker.java
// public class ClassChecker implements ViewTraversalChecker {
// 
//     private final Selector selector;
//     private final MatchPredicate matchPredicate;
// 
//     public ClassChecker(Selector selector, View root) {
//         this.selector = selector;
// 
//         final String className = selector.getTagName();
//         if (className.equals(Selector.UNIVERSAL_TAG)) {
//             matchPredicate = MatchPredicates.ALWAYS_TRUE_PREDICATE;
//         } else {
//             matchPredicate = new MatchPredicate() {
//                 public boolean matches(View view) {
//                     return className.equals(view.getClass().getSimpleName());
//                 }
//             };
//         }
//     }
// 
//     public ViewSelection check(Set<View> views) {
//         ViewSelection result = new ViewSelection();
//         for (View view : views) {
//             switch (selector.getCombinator()) {
//                 case DESCENDANT:
//                     checkDescendantsRecursively(view, result);
//                     break;
//                 case CHILD:
//                     if (!(view instanceof ViewGroup)) {
//                         continue;
//                     }
//                     checkChildren((ViewGroup) view, result);
//                     break;
//                 case ADJACENT_SIBLING:
//                     checkSiblings(view, result, true);
//                     break;
//                 case GENERAL_SIBLING:
//                     checkSiblings(view, result, false);
//                     break;
//                 default:
//                     throw new UnsupportedOperationException(
//                             "Unsupported combinator " + selector.getCombinator());
//             }
// 
//         }
//         return result;
//     }
// 
//     private void checkDescendantsRecursively(View view, Set<View> result) {
//         // Note: Using recursion. We hope that real-world layouts don't get deep
//         // enough that this causes a problem.
//         if (matchesView(view)) {
//             result.add(view);
//         }
//         if (view instanceof ViewGroup) {
//             ViewGroup group = (ViewGroup) view;
//             for (int i = 0; i < group.getChildCount(); i++) {
//                 View childView = group.getChildAt(i);
//                 checkDescendantsRecursively(childView, result);
//             }
//         }
//     }
// 
//     private void checkChildren(ViewGroup group, Set<View> result) {
//         for (int i = 0; i < group.getChildCount(); i++) {
//             View childView = group.getChildAt(i);
//             if (matchesView(childView)) {
//                 result.add(childView);
//             }
//         }
//     }
// 
//     private void checkSiblings(View view, Set<View> result, boolean isAdjacent) {
//         ViewParent parent = view.getParent();
//         if (!(parent instanceof ViewGroup)) {
//             return;
//         }
//         ViewGroup parentGroup = (ViewGroup) parent;
// 
//         int childPos = 0;
//         while (parentGroup.getChildAt(childPos) != view) {
//             childPos++;
//         }
// 
//         if (isAdjacent && parentGroup.getChildCount() > childPos + 1) {
//             View sibling = parentGroup.getChildAt(childPos + 1);
//             if (matchesView(sibling)) {
//                 result.add(sibling);
//             }
//         } else {
//             for (int i = childPos + 1; parentGroup.getChildCount() > i; i++) {
//                 View sibling = parentGroup.getChildAt(i);
//                 if (matchesView(sibling)) {
//                     result.add(sibling);
//                 }
//             }
//         }
//     }
// 
//     private boolean matchesView(View view) {
//         return matchPredicate.matches(view);
//     }
// }
// 
// Path: src/main/java/com/nikhaldimann/viewselector/selection/ViewSelection.java
// public class ViewSelection extends LinkedHashSet<View> {
// 
// }
// 
// Path: src/test-lib/src/com/nikhaldimann/viewselector/test/util/ViewSelectorAndroidTestCase.java
// public abstract class ViewSelectorAndroidTestCase extends AndroidTestCase {
// 
//     protected ViewFactory viewFactory;
// 
//     @Before
//     public void setUp() throws Exception {
//         super.setUp();
//         viewFactory = createViewFactory();
//     }
// 
//     /**
//      * @return the factory to be used for creating views in this test
//      */
//     protected abstract ViewFactory createViewFactory();
// 
//     /**
//      * Reimplementation of Android's MoreAsserts.assertContentsInOrder() because we
//      * can't use MoreAsserts in Robolectric 1.2.
//      */
//     public static void assertContentsInOrder(Iterable<?> actual, Object... expected) {
//         ArrayList<Object> actualList = new ArrayList<Object>();
//         for (Object o : actual) {
//             actualList.add(o);
//         }
//         assertEquals(Arrays.asList(expected), actualList);
//     }
// }


// Path: src/test-lib/src/com/nikhaldimann/viewselector/test/abstrakt/checker/AbstractClassCheckerTest.java
import org.junit.Test;
import se.fishtank.css.selectors.Selector;
import se.fishtank.css.selectors.Selector.Combinator;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.nikhaldimann.viewselector.checker.ClassChecker;
import com.nikhaldimann.viewselector.selection.ViewSelection;
import com.nikhaldimann.viewselector.test.util.ViewSelectorAndroidTestCase;

package com.nikhaldimann.viewselector.test.abstrakt.checker;




public abstract class AbstractClassCheckerTest extends ViewSelectorAndroidTestCase {

    private Iterable<View> check(String selectorTag, Combinator combinator, View view) {
        Selector selector = new Selector(selectorTag, combinator);
        ClassChecker checker = new ClassChecker(selector, view);
        ViewSelection selection = new ViewSelection();