@Test public void isAreaOfInterestRequestPending_passingNonnullFilterForDelete() { final Connection connection = createConnection(); final ChannelAddress address = new ChannelAddress( 1, 0 ); final String filter = "MyFilter"; final IllegalStateException exception = expectThrows( IllegalStateException.class, () -> connection.isAreaOfInterestRequestPending( AreaOfInterestRequest.Type.REMOVE, address, filter ) ); assertEquals( exception.getMessage(), "Replicant-0025: Connection.isAreaOfInterestRequestPending passed a REMOVE request for address '1.0' with a non-null filter 'MyFilter'." ); }
boolean isAreaOfInterestRequestPending( @Nonnull final AreaOfInterestRequest.Type action, @Nonnull final ChannelAddress address, @Nullable final Object filter ) { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> action != AreaOfInterestRequest.Type.REMOVE || null == filter, () -> "Replicant-0025: Connection.isAreaOfInterestRequestPending passed a REMOVE " + "request for address '" + address + "' with a non-null filter '" + filter + "'." ); } return _currentAreaOfInterestRequests.stream().anyMatch( a -> a.match( action, address, filter ) ) || _pendingAreaOfInterestRequests.stream().anyMatch( a -> a.match( action, address, filter ) ); }
Connection { boolean isAreaOfInterestRequestPending( @Nonnull final AreaOfInterestRequest.Type action, @Nonnull final ChannelAddress address, @Nullable final Object filter ) { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> action != AreaOfInterestRequest.Type.REMOVE || null == filter, () -> "Replicant-0025: Connection.isAreaOfInterestRequestPending passed a REMOVE " + "request for address '" + address + "' with a non-null filter '" + filter + "'." ); } return _currentAreaOfInterestRequests.stream().anyMatch( a -> a.match( action, address, filter ) ) || _pendingAreaOfInterestRequests.stream().anyMatch( a -> a.match( action, address, filter ) ); } }
Connection { boolean isAreaOfInterestRequestPending( @Nonnull final AreaOfInterestRequest.Type action, @Nonnull final ChannelAddress address, @Nullable final Object filter ) { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> action != AreaOfInterestRequest.Type.REMOVE || null == filter, () -> "Replicant-0025: Connection.isAreaOfInterestRequestPending passed a REMOVE " + "request for address '" + address + "' with a non-null filter '" + filter + "'." ); } return _currentAreaOfInterestRequests.stream().anyMatch( a -> a.match( action, address, filter ) ) || _pendingAreaOfInterestRequests.stream().anyMatch( a -> a.match( action, address, filter ) ); } Connection( @Nonnull final Connector connector ); }
Connection { boolean isAreaOfInterestRequestPending( @Nonnull final AreaOfInterestRequest.Type action, @Nonnull final ChannelAddress address, @Nullable final Object filter ) { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> action != AreaOfInterestRequest.Type.REMOVE || null == filter, () -> "Replicant-0025: Connection.isAreaOfInterestRequestPending passed a REMOVE " + "request for address '" + address + "' with a non-null filter '" + filter + "'." ); } return _currentAreaOfInterestRequests.stream().anyMatch( a -> a.match( action, address, filter ) ) || _pendingAreaOfInterestRequests.stream().anyMatch( a -> a.match( action, address, filter ) ); } Connection( @Nonnull final Connector connector );  }
Connection { boolean isAreaOfInterestRequestPending( @Nonnull final AreaOfInterestRequest.Type action, @Nonnull final ChannelAddress address, @Nullable final Object filter ) { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> action != AreaOfInterestRequest.Type.REMOVE || null == filter, () -> "Replicant-0025: Connection.isAreaOfInterestRequestPending passed a REMOVE " + "request for address '" + address + "' with a non-null filter '" + filter + "'." ); } return _currentAreaOfInterestRequests.stream().anyMatch( a -> a.match( action, address, filter ) ) || _pendingAreaOfInterestRequests.stream().anyMatch( a -> a.match( action, address, filter ) ); } Connection( @Nonnull final Connector connector );   }