@Override
      public Object call() {
        Region r = getCache().getRegion(CUSTOMER);
        Set keySet = r.keySet();
        Set entrySet = r.entrySet();
        Set valueSet = (Set) r.values();
        CacheTransactionManager mgr = getCache().getTXMgr();
        mgr.begin();
        // now we allow for using non-TX iterators in TX context
        assertThatThrownBy(keySet::size).isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(entrySet::size).isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(valueSet::size).isInstanceOf(IllegalStateException.class);

        assertThatThrownBy(keySet::iterator).isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(entrySet::iterator).isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(valueSet::iterator).isInstanceOf(IllegalStateException.class);

        // TX iterators
        keySet = r.keySet();
        entrySet = r.entrySet();
        valueSet = (Set) r.values();
        mgr.commit();
        // don't allow for TX iterator after TX has committed
        assertThatThrownBy(keySet::size).isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(entrySet::size).isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(valueSet::size).isInstanceOf(IllegalStateException.class);

        assertThatThrownBy(keySet::iterator).isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(entrySet::iterator).isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(valueSet::iterator).isInstanceOf(IllegalStateException.class);

        return null;
      }
When we have narrowed down on a target node for a transaction, test that we throw an exception
if that node does not host primary for subsequent entries
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RemoteTransactionDUnitTest.java