def METHOD_NAME(top_k: int):
    # tests that lost_in_the_middle order works with an odd number of documents and a top_k parameter
    docs = [Document(str(i)) for i in range(1, 10)]
    ranker = LostInTheMiddleRanker()
    result = ranker.predict(query="irrelevant", documents=docs, top_k=top_k)
    if top_k < len(docs):
        # top_k is less than the number of documents, so only the top_k documents should be returned in LITM order
        assert len(result) == top_k
        expected_order = ranker.predict(query="irrelevant", documents=[Document(str(i)) for i in range(1, top_k + 1)])
        assert result == expected_order
    else:
        # top_k is greater than the number of documents, so all documents should be returned in LITM order
        assert len(result) == len(docs)
        assert result == ranker.predict(query="irrelevant", documents=docs)