PermissionUtil implements PermissionConstants { @Nullable public static String getPath(@Nullable Tree parentBefore, @Nullable Tree parentAfter) { String path = null; if (parentBefore != null) { path = parentBefore.getPath(); } else if (parentAfter != null) { path = parentAfter.getPath(); } return path; } private  PermissionUtil(); @Nullable static String getParentPathOrNull(@NotNull final String path); @NotNull static String getEntryName(@Nullable String accessControlledPath); static boolean checkACLPath(@NotNull NodeBuilder node, @NotNull String path); static boolean checkACLPath(@NotNull Tree node, @NotNull String path); @NotNull static Tree getPermissionsRoot(@NotNull Root root, @NotNull String permissionRootName); @NotNull static Tree getPrincipalRoot(@NotNull Tree permissionsTree, @NotNull String principalName); static boolean isAdminOrSystem(@NotNull Set<Principal> principals, @NotNull ConfigurationParameters config); @Nullable static String getPath(@Nullable Tree parentBefore, @Nullable Tree parentAfter); @Nullable static Tree getReadOnlyTreeOrNull(@Nullable Tree tree, @NotNull Root readOnlyRoot); @NotNull static Tree getReadOnlyTree(@NotNull Tree tree, @NotNull Root readOnlyRoot);  }
@Test public void testGetPath() { Tree t = when(mock(Tree.class).getPath()).thenReturn("/path").getMock(); assertNull(PermissionUtil.getPath(null, null)); assertEquals("/path", PermissionUtil.getPath(t, null)); assertEquals("/path", PermissionUtil.getPath(null, t)); Tree afterT = when(mock(Tree.class).getPath()).thenReturn("/afterPath").getMock(); assertEquals("/path", PermissionUtil.getPath(t, afterT)); }