@Test public void getCurrentAreaOfInterestRequests() { final Connection connection = createConnection(); final ChannelAddress addressA = new ChannelAddress( 1, 1, 1 ); final ChannelAddress addressB = new ChannelAddress( 1, 1, 2 ); final ChannelAddress addressC = new ChannelAddress( 1, 1, 3 ); assertEquals( connection.getCurrentAreaOfInterestRequests().size(), 0 ); connection.requestSubscribe( addressA, null ); connection.requestSubscribe( addressB, null ); assertEquals( connection.getPendingAreaOfInterestRequests().size(), 2 ); assertEquals( connection.getCurrentAreaOfInterestRequests().size(), 2 ); assertEquals( connection.getPendingAreaOfInterestRequests().size(), 0 ); connection.requestSubscribe( addressA, null ); connection.requestSubscribe( addressB, null ); connection.requestSubscribe( addressC, null ); assertEquals( connection.getCurrentAreaOfInterestRequests().size(), 2 ); assertEquals( connection.getPendingAreaOfInterestRequests().size(), 3 ); }
@Nonnull List<AreaOfInterestRequest> getCurrentAreaOfInterestRequests() { if ( _currentAreaOfInterestRequests.isEmpty() && !_pendingAreaOfInterestRequests.isEmpty() ) { final AreaOfInterestRequest first = _pendingAreaOfInterestRequests.removeFirst(); _currentAreaOfInterestRequests.add( first ); while ( _pendingAreaOfInterestRequests.size() > 0 && canGroupRequests( first, _pendingAreaOfInterestRequests.get( 0 ) ) ) { _currentAreaOfInterestRequests.add( _pendingAreaOfInterestRequests.removeFirst() ); } } return CollectionsUtil.wrap( _currentAreaOfInterestRequests ); }
Connection { @Nonnull List<AreaOfInterestRequest> getCurrentAreaOfInterestRequests() { if ( _currentAreaOfInterestRequests.isEmpty() && !_pendingAreaOfInterestRequests.isEmpty() ) { final AreaOfInterestRequest first = _pendingAreaOfInterestRequests.removeFirst(); _currentAreaOfInterestRequests.add( first ); while ( _pendingAreaOfInterestRequests.size() > 0 && canGroupRequests( first, _pendingAreaOfInterestRequests.get( 0 ) ) ) { _currentAreaOfInterestRequests.add( _pendingAreaOfInterestRequests.removeFirst() ); } } return CollectionsUtil.wrap( _currentAreaOfInterestRequests ); } }
Connection { @Nonnull List<AreaOfInterestRequest> getCurrentAreaOfInterestRequests() { if ( _currentAreaOfInterestRequests.isEmpty() && !_pendingAreaOfInterestRequests.isEmpty() ) { final AreaOfInterestRequest first = _pendingAreaOfInterestRequests.removeFirst(); _currentAreaOfInterestRequests.add( first ); while ( _pendingAreaOfInterestRequests.size() > 0 && canGroupRequests( first, _pendingAreaOfInterestRequests.get( 0 ) ) ) { _currentAreaOfInterestRequests.add( _pendingAreaOfInterestRequests.removeFirst() ); } } return CollectionsUtil.wrap( _currentAreaOfInterestRequests ); } Connection( @Nonnull final Connector connector ); }
Connection { @Nonnull List<AreaOfInterestRequest> getCurrentAreaOfInterestRequests() { if ( _currentAreaOfInterestRequests.isEmpty() && !_pendingAreaOfInterestRequests.isEmpty() ) { final AreaOfInterestRequest first = _pendingAreaOfInterestRequests.removeFirst(); _currentAreaOfInterestRequests.add( first ); while ( _pendingAreaOfInterestRequests.size() > 0 && canGroupRequests( first, _pendingAreaOfInterestRequests.get( 0 ) ) ) { _currentAreaOfInterestRequests.add( _pendingAreaOfInterestRequests.removeFirst() ); } } return CollectionsUtil.wrap( _currentAreaOfInterestRequests ); } Connection( @Nonnull final Connector connector );  }
Connection { @Nonnull List<AreaOfInterestRequest> getCurrentAreaOfInterestRequests() { if ( _currentAreaOfInterestRequests.isEmpty() && !_pendingAreaOfInterestRequests.isEmpty() ) { final AreaOfInterestRequest first = _pendingAreaOfInterestRequests.removeFirst(); _currentAreaOfInterestRequests.add( first ); while ( _pendingAreaOfInterestRequests.size() > 0 && canGroupRequests( first, _pendingAreaOfInterestRequests.get( 0 ) ) ) { _currentAreaOfInterestRequests.add( _pendingAreaOfInterestRequests.removeFirst() ); } } return CollectionsUtil.wrap( _currentAreaOfInterestRequests ); } Connection( @Nonnull final Connector connector );   }