java verify function