Add receiveN to JavaTestKit. Fixes #3029