class PointerChecking {

    static void checkPointer( long result, boolean allowNoNode )
    {
        GenerationSafePointerPair.assertSuccess( result );
        if ( allowNoNode && !TreeNode.isNode( result ) )
        {
            return;
        }
        if ( result < IdSpace.MIN_TREE_NODE_ID )
        {
            throw new TreeInconsistencyException( "Pointer to id " + result + " not allowed. Minimum node id allowed is " +
                    IdSpace.MIN_TREE_NODE_ID );
        }
    }

    private  PointerChecking();

}