### Question:
LoggingBuffer { public void removeChannelFromBuffer( String id ) { lock.writeLock().lock(); try { buffer.removeIf( line -> id.equals( getLogChId( line ) ) ); } finally { lock.writeLock().unlock(); } } LoggingBuffer( int bufferSize ); int getLastBufferLineNr(); List<HopLoggingEvent> getLogBufferFromTo( List<String> channelId, boolean includeGeneral, int from,
                                                   int to ); List<HopLoggingEvent> getLogBufferFromTo( String parentLogChannelId, boolean includeGeneral, int from,
                                                   int to ); StringBuffer getBuffer( String parentLogChannelId, boolean includeGeneral, int startLineNr, int endLineNr ); StringBuffer getBuffer( String parentLogChannelId, boolean includeGeneral ); StringBuffer getBuffer( String parentLogChannelId, boolean includeGeneral, int startLineNr ); StringBuffer getBuffer(); void close(); void doAppend( HopLoggingEvent event ); void setName( String name ); String getName(); void setLayout( HopLogLayout layout ); HopLogLayout getLayout(); boolean requiresLayout(); void clear(); int getMaxNrLines(); void setMaxNrLines( int maxNrLines ); int getNrLines(); void removeChannelFromBuffer( String id ); int size(); void removeGeneralMessages(); @Deprecated @VisibleForTesting Iterator<BufferLine> getBufferIterator(); @Deprecated String dump(); @Deprecated void removeBufferLines( List<BufferLine> linesToRemove ); @Deprecated List<BufferLine> getBufferLinesBefore( long minTimeBoundary ); void removeBufferLinesBefore( long minTimeBoundary ); void addLogggingEvent( HopLoggingEvent loggingEvent ); void addLoggingEventListener( IHopLoggingEventListener listener ); void removeLoggingEventListener( IHopLoggingEventListener listener );  }### Answer:
@Test public void testRemoveChannelFromBuffer() { String logChannelId = "1"; String otherLogChannelId = "2"; LoggingBuffer loggingBuffer = new LoggingBuffer( 20 ); for ( int i = 0; i < 10; i++ ) { HopLoggingEvent event = new HopLoggingEvent(); event.setMessage( new LogMessage( "testWithLogChannelId", logChannelId, LogLevel.BASIC ) ); event.setTimeStamp( i ); loggingBuffer.addLogggingEvent( event ); } for ( int i = 10; i < 17; i++ ) { HopLoggingEvent event = new HopLoggingEvent(); event.setMessage( new LogMessage( "testWithNoLogChannelId", LogLevel.BASIC ) ); event.setTimeStamp( i ); loggingBuffer.addLogggingEvent( event ); } for ( int i = 17; i < 20; i++ ) { HopLoggingEvent event = new HopLoggingEvent(); event.setMessage( new LogMessage( "testWithOtherLogChannelId", otherLogChannelId, LogLevel.BASIC ) ); event.setTimeStamp( i ); loggingBuffer.addLogggingEvent( event ); } loggingBuffer.removeChannelFromBuffer( logChannelId ); Assert.assertEquals( 10, loggingBuffer.size() ); }