### Question:
PermissionConverter implements ToClientConverter<ObjectPermission, RepositoryPermission, ToClientConversionOptions>, ToServerConverter<RepositoryPermission, ObjectPermission, ToServerConversionOptions> { public RepositoryPermission toClient(ObjectPermission serverObject, ToClientConversionOptions options) { RepositoryPermission client = new RepositoryPermission(stripRepo(serverObject.getURI()), null, serverObject.getPermissionMask()); if (serverObject.getPermissionRecipient() instanceof InternalURI){ client.setRecipient(((InternalURI) serverObject.getPermissionRecipient()).getURI()); } else if (serverObject.getPermissionRecipient() instanceof MetadataUserDetails) { User internalUri = new UserImpl(), metaUser = (User)serverObject.getPermissionRecipient(); internalUri.setUsername(metaUser.getUsername()); internalUri.setTenantId(metaUser.getTenantId()); client.setRecipient(((InternalURI) internalUri).getURI()); } return client; }  RepositoryPermission toClient(ObjectPermission serverObject, ToClientConversionOptions options); String getClientResourceType(); ObjectPermission toServer(RepositoryPermission clientObject, ToServerConversionOptions options); ObjectPermission toServer(RepositoryPermission clientObject, ObjectPermission resultToUpdate, ToServerConversionOptions options); String getServerResourceType();  }### Answer:
@Test public void testToClient() throws Exception { RepositoryPermission converted = converter.toClient(server, null); assertEquals((int)converted.getMask(), server.getPermissionMask()); assertEquals(converted.getRecipient(), userUri); assertEquals(converted.getUri(), clientUri); }
@Test public void testToClient_metadata() throws Exception { server.setPermissionRecipient(new MetadataUserDetails(user)); RepositoryPermission converted = converter.toClient(server, null); assertEquals((int)converted.getMask(), server.getPermissionMask()); assertEquals(converted.getRecipient(), userUri); assertEquals(converted.getUri(), clientUri); }