def METHOD_NAME(self):
    data = [str(i) for i in range(257)]
    data.append(data[-1])
    for proto in range(pickle.HIGHEST_PROTOCOL + 1):
        pickled = pickle.dumps(data, proto)
        unpickled = pickle.loads(pickled)
        self.assertEqual(unpickled, data)
        self.assertIs(unpickled[-1], unpickled[-2])
        pickled2 = pickletools.optimize(pickled)
        unpickled2 = pickle.loads(pickled2)
        self.assertEqual(unpickled2, data)
        self.assertIs(unpickled2[-1], unpickled2[-2])
        self.assertNotIn(pickle.LONG_BINGET, pickled2)
        self.assertNotIn(pickle.LONG_BINPUT, pickled2)