Link link = Link.newBuilder().recordId(recordId).copyAll(false).create();
assertEquals(masterRecordId, link.getMasterRecordId());
assertEquals("USER.123.!*,branch=dev,lang=en", 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));
assertEquals(2, link.getVariantProps().size());
assertEquals(Link.PropertyMode.SET, link.getVariantProps().get("lang").getMode());
assertEquals("en", link.getVariantProps().get("lang").getValue());