Code example for LocalServerSocket

Methods: close

    public void tearDown() throws Exception { 
        if (mSocket != null) mSocket.close();
        if (mServerSocket != null) mServerSocket.close();
     * Sends a message on the netd socket and gives the events some time to make it back. 
    private void sendMessage(String message) throws IOException {
        // Strings are null-terminated, so add "\0" at the end. 
        mOutputStream.write((message + "\0").getBytes());
    private static <T> T expectSoon(T mock) {
        return verify(mock, timeout(100));
Connect your IDE to all the code out there  Get Codota for Java