### Question:
AbstractPolicyBasedAuthorizer implements ManagedAuthorizer { @Override public final void inheritFingerprint(final String fingerprint) throws AuthorizationAccessException { if (fingerprint == null || fingerprint.trim().isEmpty()) { return; } final PoliciesUsersAndGroups policiesUsersAndGroups = parsePoliciesUsersAndGroups(fingerprint); policiesUsersAndGroups.getUsers().forEach(user -> addUser(user)); policiesUsersAndGroups.getGroups().forEach(group -> addGroup(group)); policiesUsersAndGroups.getAccessPolicies().forEach(policy -> addAccessPolicy(policy)); }  @Override final void onConfigured(final AuthorizerConfigurationContext configurationContext); @Override final AuthorizationResult authorize(AuthorizationRequest request); final synchronized Group addGroup(Group group); abstract Group doAddGroup(Group group); abstract Group getGroup(String identifier); final synchronized Group updateGroup(Group group); abstract Group doUpdateGroup(Group group); abstract Group deleteGroup(Group group); abstract Set<Group> getGroups(); final synchronized User addUser(User user); abstract User doAddUser(User user); abstract User getUser(String identifier); abstract User getUserByIdentity(String identity); final synchronized User updateUser(final User user); abstract User doUpdateUser(User user); abstract User deleteUser(User user); abstract Set<User> getUsers(); final synchronized AccessPolicy addAccessPolicy(AccessPolicy accessPolicy); abstract AccessPolicy getAccessPolicy(String identifier); abstract AccessPolicy updateAccessPolicy(AccessPolicy accessPolicy); abstract AccessPolicy deleteAccessPolicy(AccessPolicy policy); abstract Set<AccessPolicy> getAccessPolicies(); abstract UsersAndAccessPolicies getUsersAndAccessPolicies(); @Override final void checkInheritability(String proposedFingerprint); @Override final void inheritFingerprint(final String fingerprint); @Override final AccessPolicyProvider getAccessPolicyProvider(); @Override final String getFingerprint();  }### Answer:
@Test public void testInheritFingerprint() { User user1 = new User.Builder().identifier("user-id-1").identity("user-1").build(); User user2 = new User.Builder().identifier("user-id-2").identity("user-2").build(); Group group1 = new Group.Builder().identifier("group-id-1").name("group-1").addUser(user1.getIdentifier()).build(); Group group2 = new Group.Builder().identifier("group-id-2").name("group-2").build(); AccessPolicy policy1 = new AccessPolicy.Builder() .identifier("policy-id-1") .resource("resource1") .action(RequestAction.READ) .addUser(user1.getIdentifier()) .addUser(user2.getIdentifier()) .build(); AccessPolicy policy2 = new AccessPolicy.Builder() .identifier("policy-id-2") .resource("resource2") .action(RequestAction.READ) .addGroup(group1.getIdentifier()) .addGroup(group2.getIdentifier()) .addUser(user1.getIdentifier()) .addUser(user2.getIdentifier()) .build(); Set<Group> groups1 = new LinkedHashSet<>(); groups1.add(group1); groups1.add(group2); Set<User> users1 = new LinkedHashSet<>(); users1.add(user1); users1.add(user2); Set<AccessPolicy> policies1 = new LinkedHashSet<>(); policies1.add(policy1); policies1.add(policy2); AbstractPolicyBasedAuthorizer authorizer1 = Mockito.mock(AbstractPolicyBasedAuthorizer.class); when(authorizer1.getGroups()).thenReturn(groups1); when(authorizer1.getUsers()).thenReturn(users1); when(authorizer1.getAccessPolicies()).thenReturn(policies1); final String fingerprint1 = authorizer1.getFingerprint(); AbstractPolicyBasedAuthorizer authorizer2 = new MockPolicyBasedAuthorizer(); authorizer2.inheritFingerprint(fingerprint1); final String fingerprint2 = authorizer2.getFingerprint(); assertEquals(fingerprint1, fingerprint2); assertEquals(authorizer1.getUsers(), authorizer2.getUsers()); assertEquals(authorizer1.getGroups(), authorizer2.getGroups()); assertEquals(authorizer1.getAccessPolicies(), authorizer2.getAccessPolicies()); }