AuthorizationTree implements AuthorizationInfo { @Override public Optional<String> getRealWorldIdentity(String blockchainAddress) { final Optional<AuthorizationNode> result = tree.breadthFirstSearch(node -> node.getAddress().equals(blockchainAddress)); return result.map(AuthorizationNode::getIdentity); } AuthorizationTree(List<AuthorizationElement> allAuthorizationElements); @Override boolean isAuthorized(String blockchainAddress); @Override Optional<String> getServiceOwnerBlockchainAddress(); @Override Optional<String> getRealWorldIdentity(String blockchainAddress); @Override Optional<List<AuthorizationNode>> getAuthorizationLineage(String blockchainAddress); @Override String toString();  }
@Test public void checkIdentity() { final Optional<String> realWorldIdentity = this.authorizationTree.getRealWorldIdentity("0x3333"); assertTrue(realWorldIdentity.isPresent()); assertEquals("Vladimir", realWorldIdentity.get()); }
@Test public void multipleParticipantIdentities() { Optional<String> identity = this.authorizationTree.getRealWorldIdentity("0x3333"); assertTrue(identity.isPresent()); assertEquals("Vladimir", identity.get()); }