### Question:
UserProfile extends BaseVersionedNetworkContent { public Index getFileById(PublicKey fileId) { return findById(root, fileId); } UserProfile(String userId, KeyPair encryptionKeys, KeyPair protectionKeys); String getUserId(); KeyPair getEncryptionKeys(); KeyPair getProtectionKeys(); FolderIndex getRoot(); @Override int getTimeToLive(); Index getFileById(PublicKey fileId); Index getFileByPath(File file, File root);  }### Answer:
@Test public void testGetFileById() { FolderIndex root = userProfile.getRoot(); KeyPair child1Key = generateRSAKeyPair(RSA_KEYLENGTH.BIT_512); FolderIndex child1Folder = new FolderIndex(root, child1Key, randomString()); KeyPair child2Key = generateRSAKeyPair(RSA_KEYLENGTH.BIT_1024); new FileIndex(root, child2Key, randomString(), "bla".getBytes()); KeyPair child3Key = generateRSAKeyPair(RSA_KEYLENGTH.BIT_2048); new FileIndex(child1Folder, child3Key, randomString(), "blubb".getBytes()); Assert.assertNotNull(userProfile.getFileById(child1Key.getPublic())); Assert.assertNotNull(userProfile.getFileById(child2Key.getPublic())); Assert.assertNotNull(userProfile.getFileById(child3Key.getPublic())); }