Ok, now that I read more about this issue and implemented something I'll try to answer it myself.
The standard WebSocket Interface has only the methods
onOpen(Connection con)
and
onClose(int closeCode, String message)
with the Connection you acquire when a WebSocket is opened you can send messages to the Browser (binary, or text).
So the standard WebSocket Interface is basically just for opening a connection and sending messages to the browser.
You don't have to deal there with the other functions, e.g. when messages arrive from the Browser.
If you want additional functionality there are the other Subinterfaces of WebSocket: Websocket.OnFrame, OnBinaryMessage, OnTextMessage, OnControl
So now if you want for your WebSocket to handle text messages and binary messages you have to implement it like this:
class MyWebSocket implements WebSocket.OnTextMessage, WebSocket.OnBinaryMessage{
// Implementation
}
You always only need to implement the interfaces that you need for your task and not all the other functions if they are irrelevant to you. This simplifies the code and reduces code length.