### Question:
RoleLink extends Role { @Override public Binder serialize(BiSerializer s) { return super.serialize(s).putAll( "name", getName(), "target_name", roleName ); } private  RoleLink();  RoleLink(String name,Contract contract); @Deprecated  RoleLink(String name);  RoleLink(String name, Contract contract, String roleName); @Deprecated  RoleLink(String name, String roleName); @Nullable Role getRole(); @Override T resolve(); T resolve(boolean ignoreRefs); @Override @Deprecated Set<KeyRecord> getKeyRecords(); @Override @Deprecated Set<AnonymousId> getAnonymousIds(); @Override @Deprecated Set<KeyAddress> getKeyAddresses(); @Override @Deprecated Set<PublicKey> getKeys(); @Override boolean isAllowedForKeysQuantized(Set<? extends AbstractKey> keys); @Override boolean isValid(); @Override @Deprecated boolean equalKeys(Role otherRole); @Override void initWithDsl(Binder serializedRole); @Override String toString(); @Override Binder serialize(BiSerializer s); @Override void deserialize(Binder data, BiDeserializer deserializer); @Override void anonymize();  }### Answer:
@Test public void serialize() throws Exception { RoleLink r1 = new RoleLink("name", "target"); r1.addRequiredReference("ref", Role.RequiredMode.ALL_OF); Binder s = DefaultBiMapper.serialize(r1); RoleLink r2 = DefaultBiMapper.deserialize(s); assertEquals(r1, r2); assertEquals(r1.getName(), r2.getName()); }