@@ -0,0 +1,1849 @@
+// ReplPairTest.java%0A%0Apackage com.mongodb;%0A%0Aimport java.util.*;%0A%0Apublic class ReplPairTest %7B%0A%0A    static class R extends Thread %7B%0A        R( ServerAddress a )%7B%0A            _a = a;%0A            _mongo = new Mongo(a);%0A            _db = _mongo.getDB( %22test%22 );%0A            _coll = _db.getCollection( %22foo%22 );%0A            %0A            _coll.slaveOk();%0A        %7D%0A        %0A        public void run()%7B%0A            while ( true )%7B%0A                try %7B%0A                    Thread.sleep( 500 );%0A                    _coll.findOne();%0A                %7D%0A                catch ( NullPointerException n )%7B%0A                    n.printStackTrace();%0A                %7D%0A                catch ( Exception e )%7B%0A                    System.out.println( _a + %22%5Ct%22 + e );%0A                %7D%0A            %7D%0A        %7D%0A        %0A        final ServerAddress _a;%0A        final Mongo _mongo;%0A        final DB _db;%0A        final DBCollection _coll;%0A    %7D%0A%0A    public static void main( String args%5B%5D )%0A        throws Exception %7B%0A        %0A        List%3CServerAddress%3E addrs = new ArrayList%3CServerAddress%3E();%0A        addrs.add( new ServerAddress( %22localhost%22 , 9998 ) );%0A        addrs.add( new ServerAddress( %22localhost%22 , 9999 ) );%0A%0A        Mongo m = new Mongo ( addrs );%0A        DB db = m.getDB( %22test%22 );%0A        DBCollection c = db.getCollection( %22foo%22 );%0A        c.insert( new BasicDBObject( %22_id%22 , 17 ) );%0A        c.slaveOk();%0A%0A        for ( ServerAddress a : addrs )%7B%0A            new R(a).start();%0A        %7D%0A        %0A        while ( true )%7B%0A            Thread.sleep( 500 );%0A            try %7B%0A                System.out.println( c.findOne() );%0A                c.update( new BasicDBObject( %22_id%22 , 17 ) , new BasicDBObject( %22$inc%22 , new BasicDBObject( %22x%22 , 1 ) ) );%0A            %7D%0A            catch ( Exception e )%7B%0A                e.printStackTrace();%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

add a pair test for changes for JAVA-147