@Override
    public String getFileId(final DriveItem.Metadata metadata) {
        final ItemReference parent = metadata.getParentReference();
        if(metadata.getRemoteItem() != null) {
            final DriveItem.Metadata remoteMetadata = metadata.getRemoteItem();
            final ItemReference remoteParent = remoteMetadata.getParentReference();
            if(parent == null) {
                return String.join(String.valueOf(Path.DELIMITER),
                        remoteParent.getDriveId(), remoteMetadata.getId());
            }
            else {
                return String.join(String.valueOf(Path.DELIMITER),
                        parent.getDriveId(), metadata.getId(),
                        remoteParent.getDriveId(), remoteMetadata.getId());
            }
        }
        else {
            return String.join(String.valueOf(Path.DELIMITER), parent.getDriveId(), metadata.getId());
        }
    }
@Test
    public void testParentReferenceFileIdUnknownId() throws Exception {
        final DriveItem.Metadata metadata;
        try (final InputStream test = getClass().getResourceAsStream("/ParentReferenceFileIdUnknownId.json")) {
            final InputStreamReader reader = new InputStreamReader(test);
            metadata = DriveItem.parseJson(session.getClient(), (JsonObject) Json.parse(reader));
        }

        assertEquals("ParentDriveId/MyId", session.getFileId(metadata));
    }