RecordId recordId = idGenerator.newRecordId("123");
Link link = Link.newBuilder().recordId(recordId).copyAll(false).copy("branch").set("x", "1").create();
assertEquals("USER.123.!*,+branch,x=1", link.toString());
assertEquals(link, Link.fromString(link.toString(), idGenerator));
DataOutput dataOutput = new DataOutputImpl();
link.write(dataOutput);
assertEquals(link, Link.read(new DataInputImpl(dataOutput.toByteArray()), idGenerator));
Map<String, String> ctxVarProps = new HashMap<String, String>();
ctxVarProps.put("lang", "en");
ctxVarProps.put("branch", "dev");