@Deprecated
    public static int findCounterIdBySession(final CountersReader countersReader, final int sessionId)
    {
        return findCounterIdBySession(countersReader, sessionId, Aeron.NULL_VALUE);
    }
@Test
    void shouldFindBySessionIdAndArchiveId()
    {
        final int sessionId = 888;
        final long archiveId = 19;
        final int sourceIdentityLength = 3;
        final CountersReader countersReader = mock(CountersReader.class);
        when(countersReader.maxCounterId()).thenReturn(5);
        when(countersReader.getCounterState(anyInt())).thenReturn(RECORD_ALLOCATED);
        when(countersReader.getCounterTypeId(anyInt())).thenReturn(RECORDING_POSITION_TYPE_ID);
        final AtomicBuffer metaBuffer = mock(AtomicBuffer.class);
        when(countersReader.metaDataBuffer()).thenReturn(metaBuffer);
        when(metaBuffer.getInt(METADATA_LENGTH + KEY_OFFSET + SESSION_ID_OFFSET)).thenReturn(sessionId);
        final int keyOffset = 2 * METADATA_LENGTH + KEY_OFFSET;
        when(metaBuffer.getInt(keyOffset + SESSION_ID_OFFSET)).thenReturn(sessionId);
        when(metaBuffer.getInt(keyOffset + SOURCE_IDENTITY_LENGTH_OFFSET)).thenReturn(sourceIdentityLength);
        when(metaBuffer.getLong(keyOffset + SOURCE_IDENTITY_OFFSET + sourceIdentityLength)).thenReturn(archiveId);

        assertEquals(2, RecordingPos.findCounterIdBySession(countersReader, sessionId, archiveId));

        assertEquals(
            NULL_RECORDING_ID,
            RecordingPos.findCounterIdBySession(countersReader, sessionId, Long.MIN_VALUE));

        assertEquals(1, RecordingPos.findCounterIdBySession(countersReader, sessionId, NULL_VALUE));
    }