@Test public void completeAreaOfInterestRequest() { final Connection connection = createConnection(); final ChannelAddress address1 = new ChannelAddress( 1, 0, 1 ); final ChannelAddress address2 = new ChannelAddress( 1, 0, 2 ); final Object filter1 = null; final Object filter2 = null; final AreaOfInterestRequest request1 = new AreaOfInterestRequest( address1, AreaOfInterestRequest.Type.ADD, filter1 ); final AreaOfInterestRequest request2 = new AreaOfInterestRequest( address2, AreaOfInterestRequest.Type.ADD, filter2 ); connection.injectCurrentAreaOfInterestRequest( request1 ); connection.injectCurrentAreaOfInterestRequest( request2 ); request1.markAsInProgress( 1 ); request2.markAsInProgress( 2 ); assertTrue( request1.isInProgress() ); assertTrue( request1.isInProgress() ); assertEquals( connection.getCurrentAreaOfInterestRequests().size(), 2 ); connection.completeAreaOfInterestRequest(); assertFalse( request1.isInProgress() ); assertFalse( request1.isInProgress() ); assertEquals( connection.getCurrentAreaOfInterestRequests().size(), 0 ); }
void completeAreaOfInterestRequest() { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> !_currentAreaOfInterestRequests.isEmpty(), () -> "Replicant-0023: Connection.completeAreaOfInterestRequest() invoked when there is no current AreaOfInterest requests." ); } _currentAreaOfInterestRequests.forEach( AreaOfInterestRequest::markAsComplete ); _currentAreaOfInterestRequests.clear(); }
Connection { void completeAreaOfInterestRequest() { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> !_currentAreaOfInterestRequests.isEmpty(), () -> "Replicant-0023: Connection.completeAreaOfInterestRequest() invoked when there is no current AreaOfInterest requests." ); } _currentAreaOfInterestRequests.forEach( AreaOfInterestRequest::markAsComplete ); _currentAreaOfInterestRequests.clear(); } }
Connection { void completeAreaOfInterestRequest() { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> !_currentAreaOfInterestRequests.isEmpty(), () -> "Replicant-0023: Connection.completeAreaOfInterestRequest() invoked when there is no current AreaOfInterest requests." ); } _currentAreaOfInterestRequests.forEach( AreaOfInterestRequest::markAsComplete ); _currentAreaOfInterestRequests.clear(); } Connection( @Nonnull final Connector connector ); }
Connection { void completeAreaOfInterestRequest() { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> !_currentAreaOfInterestRequests.isEmpty(), () -> "Replicant-0023: Connection.completeAreaOfInterestRequest() invoked when there is no current AreaOfInterest requests." ); } _currentAreaOfInterestRequests.forEach( AreaOfInterestRequest::markAsComplete ); _currentAreaOfInterestRequests.clear(); } Connection( @Nonnull final Connector connector );  }
Connection { void completeAreaOfInterestRequest() { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> !_currentAreaOfInterestRequests.isEmpty(), () -> "Replicant-0023: Connection.completeAreaOfInterestRequest() invoked when there is no current AreaOfInterest requests." ); } _currentAreaOfInterestRequests.forEach( AreaOfInterestRequest::markAsComplete ); _currentAreaOfInterestRequests.clear(); } Connection( @Nonnull final Connector connector );   }