private static ImmutableRoot getImmutableRoot(@Nonnull Root base, @Nonnull SecurityConfiguration acConfig) {
if (base instanceof ImmutableRoot) {
return (ImmutableRoot) base;
} else {
return new ImmutableRoot(base, new TreeTypeProviderImpl(acConfig.getContext()));
}
}