def METHOD_NAME(self):
    """
    Test a simple protocol with preamble, sync and length field and some random data
    :return:
    """
    mb = MessageTypeBuilder("simple_test")
    mb.add_label(FieldType.Function.PREAMBLE, 8)
    mb.add_label(FieldType.Function.SYNC, 16)
    mb.add_label(FieldType.Function.LENGTH, 8)
    num_messages_by_data_length = {8: 5, 16: 10, 32: 15}
    pg = ProtocolGenerator([mb.message_type], syncs_by_mt={mb.message_type: "0x9a9d"})
    for data_length, num_messages in num_messages_by_data_length.items():
        for _ in range(num_messages):
            pg.generate_message(data=pg.decimal_to_bits(random.randint(0, 2 ** data_length - 1), data_length))
    self.save_protocol("simple", pg)
    plt.subplot("221")
    plt.title("All messages")
    format_finder = FormatFinder(pg.protocol.messages)
    for i, sync_end in enumerate(format_finder.sync_ends):
        self.assertEqual(sync_end, 24, msg=str(i))
    h = Histogram(format_finder.bitvectors)
    h.subplot_on(plt)
    bitvectors = FormatFinder.get_bitvectors_from_messages(pg.protocol.messages)
    bitvectors_by_length = defaultdict(list)
    for bitvector in bitvectors:
        bitvectors_by_length[len(bitvector)].append(bitvector)
    for i, (message_length, bitvectors) in enumerate(bitvectors_by_length.items()):
        plt.subplot(2, 2, i + 2)
        plt.title("Messages with length {} ({})".format(message_length, len(bitvectors)))
        Histogram(bitvectors).subplot_on(plt)
    if SHOW_PLOTS:
        plt.show()