Code example for Gson

0
public class Handshake { 
    private final ClientStub clientStub;
 
    protected static final Logger logger = Logger.getLogger("adapter"); 
 
    protected final Gson gson = new Gson();
 
    public Handshake(ClientStub clientStub) {
        this.clientStub = clientStub;
    } 
 
    // execute handshake with client. 
    // 1. discovery: issue uuid; 
    // 2. main connect: create connection 
    public ClientConnection execute(Socket s) {
        byte[] v;
 
        try { 
            ClientConnection conn = null;