### Question:
PrimusHeartBeatsHelper { public static void sendHeartBeatsResponse(final WebSocket webSocket) { if (webSocket != null) { webSocket.writeTextMessage(String.format("\"primus::pong::%d\"", System.currentTimeMillis())); } }  static boolean isHeartBeatsRequest(final String request); static void sendHeartBeatsResponse(final WebSocket webSocket); static final Pattern PRIMUS_PING_REGEX; }### Answer:
@Test public void shouldSendValidPrimusPong() { final WebSocket webSocket = mock(WebSocket.class); PrimusHeartBeatsHelper.sendHeartBeatsResponse(webSocket); final ArgumentCaptor<String> pongMessageCaptor = ArgumentCaptor.forClass(String.class); verify(webSocket, times(1)).writeTextMessage(pongMessageCaptor.capture()); assertThat(PRIMUS_PONG_REGEX.matcher(pongMessageCaptor.getValue()).find()).isTrue(); }