espresso onData matches multiple views in the hierarchy
<p>I have an Activity with 2 ListView, I want to find first ListView's Child but I find first ListView's Child and second ListView, why? please help me.</p>

<p>code:</p>

<pre><code>DataInteraction dataInteraction =
            onData(allOf(
                    withClassName(endsWith("LinearLayout")),
                    hasSibling(withText("9.0")),
                    hasSibling(withText("衬衫"))
            ));
        dataInteraction.onChildView(withId(R.id.order_untake_jijia_listview_jia))
                .atPosition(0);
        dataInteraction.perform(ViewActions.click());
</code></pre>

<p>It find:</p>

<pre><code>ListView{id=2131493579, res-name=order_jijia_listview, visibility=VISIBLE, width=768,
            height=659, has-focus=false, has-focusable=true, has-window-focus=true, 
            is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, 
            is-layout-requested=false, is-selected=false, root-is-layout-requested=false, 
            has-input-connection=false, x=0.0, y=345.0, child-count=7} ****MATCHES****

ListView{id=2131493586, res-name=order_jijia_pop_listview, visibility=VISIBLE, 
            width=0, height=0, has-focus=false, has-focusable=false, 
            has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, 
            is-focusable=false, is-layout-requested=true, is-selected=false, 
            root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0,
            child-count=0} ****MATCHES****
</code></pre>