METHOD_0 ( ) { com . allanbank . mongodb . client . state . IDENT_0 cluster = new com . allanbank . mongodb . client . state . METHOD_1 ( new com . allanbank . mongodb . METHOD_2 ( ) , com . allanbank . mongodb . client . IDENT_1 . IDENT_2 ) ; com . allanbank . mongodb . client . state . IDENT_3 server = cluster . add ( "foo" ) ; final com . allanbank . mongodb . client . connection . IDENT_4 IDENT_5 = METHOD_3 ( com . allanbank . mongodb . client . connection . IDENT_4 . class ) ; expect ( IDENT_5 . METHOD_4 ( ) ) . andReturn ( server ) ; IDENT_5 . close ( ) ; METHOD_5 ( ) ; replay ( IDENT_5 ) ; final com . allanbank . mongodb . client . connection . proxy . IDENT_6 . IDENT_7 conn = new com . allanbank . mongodb . client . connection . proxy . IDENT_6 . METHOD_6 ( IDENT_5 ) ; "<AssertPlaceHolder>" ; com . allanbank . mongodb . util . IDENT_8 . close ( conn ) ; verify ( IDENT_5 ) ; } METHOD_4 ( ) { com . allanbank . mongodb . client . state . IDENT_3 server = IDENT_9 ; if ( server != null ) { return server ; } return IDENT_10 . METHOD_7 ( ) . get ( 0 ) ; }
org . junit . Assert . assertThat ( conn . METHOD_4 ( ) , org . hamcrest . CoreMatchers . is ( server ) )