@Deprecated
    public static int findCounterIdByRecording(final CountersReader countersReader, final long recordingId)
    {
        return findCounterIdByRecording(countersReader, recordingId, Aeron.NULL_VALUE);
    }
@Test
    void shouldFindByRecordingIdAndArchiveId()
    {
        final long recordingId = 42;
        final long archiveId = 19;
        final int sourceIdentityLength = 10;
        final CountersReader countersReader = mock(CountersReader.class);
        when(countersReader.maxCounterId()).thenReturn(5);
        when(countersReader.getCounterState(anyInt())).thenReturn(RECORD_ALLOCATED);
        when(countersReader.getCounterTypeId(0)).thenReturn(0);
        when(countersReader.getCounterTypeId(2)).thenReturn(0);
        when(countersReader.getCounterTypeId(1)).thenReturn(RECORDING_POSITION_TYPE_ID);
        when(countersReader.getCounterTypeId(3)).thenReturn(RECORDING_POSITION_TYPE_ID);
        final AtomicBuffer metaBuffer = mock(AtomicBuffer.class);
        when(countersReader.metaDataBuffer()).thenReturn(metaBuffer);
        when(metaBuffer.getLong(METADATA_LENGTH + KEY_OFFSET + RECORDING_ID_OFFSET)).thenReturn(recordingId);
        final int keyOffset = 3 * METADATA_LENGTH + KEY_OFFSET;
        when(metaBuffer.getLong(keyOffset + RECORDING_ID_OFFSET)).thenReturn(recordingId);
        when(metaBuffer.getInt(keyOffset + SOURCE_IDENTITY_LENGTH_OFFSET)).thenReturn(sourceIdentityLength);
        when(metaBuffer.getLong(keyOffset + SOURCE_IDENTITY_OFFSET + sourceIdentityLength)).thenReturn(archiveId);

        assertEquals(3, RecordingPos.findCounterIdByRecording(countersReader, recordingId, archiveId));

        assertEquals(
            NULL_RECORDING_ID,
            RecordingPos.findCounterIdByRecording(countersReader, recordingId, Long.MIN_VALUE));

        assertEquals(1, RecordingPos.findCounterIdByRecording(countersReader, recordingId, NULL_VALUE));
    }