recursion – Problem of Java binary search trees

They give me the following problem that I can not reach.

Implement a method that gives as parameters a binary search tree and
a value,
returns the largest immediate value.

  • That is, given the following tree:
    enter the description of the image here

    • The immediate value of May 3 would be 8

    • The immediate value greater than 14 could return -1 because it does not have

    • The immediate value greater than 4 it would be 6.

NOTE: The solution must be implemented in Java.