PrincipalPermissionEntries { @Nullable Collection<PermissionEntry> getEntriesByPath(@NotNull String path) { return emptyPaths.containsKey(path) ? emptySet() : entries.get(path); } PrincipalPermissionEntries();   PrincipalPermissionEntries(long expectedSize);   }
@Test public void testGetEntriesByPathUponCreation() { assertNull(new PrincipalPermissionEntries(1).getEntriesByPath("/path")); assertNull(new PrincipalPermissionEntries().getEntriesByPath("/path")); }
@Test public void testGetEntriesByPath() { PrincipalPermissionEntries ppe = new PrincipalPermissionEntries(2); Collection<PermissionEntry> collection = ImmutableSet.of(permissionEntry); Map<String, Collection<PermissionEntry>> allEntries = ImmutableMap.of("/path", collection, "/path2", collection); ppe.putAllEntries(allEntries); assertEquals(collection, ppe.getEntriesByPath("/path")); assertEquals(collection, ppe.getEntriesByPath("/path2")); assertNull(ppe.getEntriesByPath("/nonExisting")); }