protected String getLogBuffer( VariableSpace space, String logChannelId, LogStatus status, String limit ) {
    return getLogBuffer( space, logChannelId, status, limit, 0 );
  }
@Test
  public void testSecondJobExecutionDoesNotReturnLogFromFirstExecution() throws Exception {
    try ( MockedStatic<KettleLogStore> kettleLogStoreMockedStatic = mockStatic( KettleLogStore.class );
          MockedStatic<LoggingRegistry> loggingRegistryMockedStatic = mockStatic( LoggingRegistry.class ) ) {

      LoggingBuffer lb = spy( new LoggingBuffer( 10 ) );
      kettleLogStoreMockedStatic.when( KettleLogStore::getAppender ).thenReturn( lb );
      doCallRealMethod().when( lb ).getBuffer( anyString(), anyBoolean(), anyInt() );

      LoggingRegistry lr = mock( LoggingRegistry.class );
      loggingRegistryMockedStatic.when( LoggingRegistry::getInstance ).thenReturn( lr );
      doReturn( List.of( "1" ) ).when( lr ).getLogChannelChildren( anyString() );

      Field privateLoggingRegistryField = LoggingBuffer.class.getDeclaredField( "loggingRegistry" );
      privateLoggingRegistryField.setAccessible( true );
      ReflectionUtils.setField( privateLoggingRegistryField, lb, lr );

      ConcurrentSkipListMap<Integer, BufferLine> bl = new ConcurrentSkipListMap<>();
      Field privateLBufferField = LoggingBuffer.class.getDeclaredField( "buffer" );
      privateLBufferField.setAccessible( true );
      ReflectionUtils.setField( privateLBufferField, lb, bl );

      KettleLoggingEvent kLE1 = spy( KettleLoggingEvent.class );
      LogMessage lm = new LogMessage( "First Job Execution Logging Event", "1", LogLevel.BASIC );
      kLE1.setMessage( lm );
      BufferLine firstBufferLine = new BufferLine( kLE1 );
      Field bufferSequenceNum = BufferLine.class.getDeclaredField( "sequence" );
      ReflectionUtils.makeAccessible( bufferSequenceNum );
      int startingBufferSequence =
        ( (AtomicInteger) ReflectionUtils.getField( bufferSequenceNum, firstBufferLine ) ).intValue();
      addToBuffer( bl, firstBufferLine );

      VariableSpace vs = mock( VariableSpace.class );

      BaseLogTable baseLogTable = new BaseLogTableTestImpl( vs, null, "", "", "" );

      String s1 = baseLogTable.getLogBuffer( vs, "1", LogStatus.START, "", startingBufferSequence );
      assertTrue( s1.contains( "First Job Execution Logging Event" ) );

      KettleLoggingEvent kLE2 = spy( KettleLoggingEvent.class );
      LogMessage lm2 = new LogMessage( "Second Job Execution Logging Event", "1", LogLevel.BASIC );
      kLE2.setMessage( lm2 );
      addToBuffer( bl, new BufferLine( kLE2 ) );

      String s2 = baseLogTable.getLogBuffer( vs, "1", LogStatus.START, "", startingBufferSequence + 1 );
      assertFalse( s2.contains( "First Job Execution Logging Event" ) );
      assertTrue( s2.contains( "Second Job Execution Logging Event" ) );
    }
  }