    @SuppressWarnings("unchecked")
    @Test
    public void testOnlySerialisesTestSpecificLogs() {

        TestIdentifier test = new TestIdentifier(CLASS1_NAME, TEST1_NAME);
        SpyLogCatWriter logCatWriter = new SpyLogCatWriter();
        LogCatSerializer serializer = new LogCatSerializer(test, logCatWriter);

        List<LogCatMessage> logCatMessages = new ArrayList<>();
        addTestStartEnd(logCatMessages, TEST2_NAME, CLASS1_NAME);
        addTestStartEnd(logCatMessages, TEST1_NAME, CLASS1_NAME);
        addTestStartEnd(logCatMessages, TEST2_NAME, CLASS2_NAME);
        addTestStartEnd(logCatMessages, TEST1_NAME, CLASS2_NAME);
        serializer.serializeLogs(logCatMessages);

        MatcherAssert.assertThat(logCatWriter.logCatMessages, IsIterableContainingInOrder.contains(
                logCatMessageWithString(startedMessage(TEST1_NAME, CLASS1_NAME)),
                logCatMessageWithString(finishedMessage(TEST1_NAME, CLASS1_NAME))
        ));
    }