### Question:
JpaFeedOpsAccessControlProvider extends AbstractCacheBackedProvider<JpaFeedOpsAclEntry, JpaFeedOpsAclEntry.EntryId> implements FeedOpsAccessControlProvider { @Override public void grantAccess(ID feedId, Principal principal, Principal... more) { Set<JpaFeedOpsAclEntry> entries = createEntries(feedId, Stream.concat(Stream.of(principal), Arrays.stream(more))); this.saveList(entries); } @Autowired  JpaFeedOpsAccessControlProvider(FeedOpsAccessControlRepository feedOpsAccessControlRepository); @Override JpaFeedOpsAclEntry.EntryId getId(JpaFeedOpsAclEntry value); @Override String getClusterMessageKey(); String getProviderName(); @Override void grantAccess(ID feedId, Principal principal, Principal... more); @Override void grantAccessOnly(ID feedId, Principal principal, Principal... more); @Override void grantAccess(ID feedId, Set<Principal> principals); @Override void grantAccessOnly(ID feedId, Set<Principal> principals); @Override void revokeAccess(ID feedId, Principal principal, Principal... more); @Override void revokeAccess(ID feedId, Set<Principal> principals); @Override void revokeAllAccess(Principal principal, Principal... more); @Override void revokeAllAccess(Set<Principal> principals); @Override void revokeAllAccess(ID feedId); @Override Set<Principal> getPrincipals(ID feedId); List<JpaFeedOpsAclEntry> findAll(); List<JpaFeedOpsAclEntry> findForFeed(String feedId);  }### Answer:
@Test public void testGrantAccess() { metadata.commit(() -> { this.opsAccessProvider.grantAccess(FEED_ID1, USER1); this.opsAccessProvider.grantAccess(FEED_ID2, USER1, USER2); }, MetadataAccess.SERVICE); Set<Principal> set1 = metadata.read(() -> { return this.opsAccessProvider.getPrincipals(FEED_ID1); }, MetadataAccess.SERVICE); assertThat(set1) .hasSize(1) .containsOnly(USER1); Set<Principal> set2 = metadata.read(() -> { return this.opsAccessProvider.getPrincipals(FEED_ID2); }, MetadataAccess.SERVICE); assertThat(set2) .hasSize(2) .containsOnly(USER1, USER2); }