Semantic search with Java API

I am trying to search openai models using this Java client: GitHub - TheoKanning/openai-java: OpenAI GPT-3 Api Client in Java. I set up the library and all test cases are green. My goal was to use embeddings to do the search as per the official recommendation shown in this example with python:
OpenAI API.

Where I am stuck is at converting this line:

  df.ada_embedding.apply(lambda x: cosine_similarity(x, embedding))

I looked into the Model, the Embedding, and the Engine classes and could not find any method doing something similar to this. Any thoughts?