AuthorizationTree implements AuthorizationInfo { @Override public Optional<String> getServiceOwnerBlockchainAddress() { final Optional<AuthorizationNode> root = tree.depthFirstStream().findFirst(); return root.map(AuthorizationNode::getAddress); } 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 getServiceOwner() { assertTrue(this.authorizationTree.getServiceOwnerBlockchainAddress().isPresent()); assertEquals("0x1111", this.authorizationTree.getServiceOwnerBlockchainAddress().get()); }