Handle case where at least one of {@code a} or {@code b} is
{@link #EMPTY}. In the following diagrams, the symbol {@code $} is used
to represent {@link #EMPTY}.
<h2>Local-Context Merges</h2>
<p>These local-context merge operations are used when {@code rootIsWildcard}
is true.</p>
<p>{@link #EMPTY} is superset of any graph; return {@link #EMPTY}.<br>
<embed src="images/LocalMerge_EmptyRoot.svg" type="image/svg+xml"/></p>
<p>{@link #EMPTY} and anything is {@code #EMPTY}, so merged parent is
{@code #EMPTY}; return left graph.<br>
<embed src="images/LocalMerge_EmptyParent.svg" type="image/svg+xml"/></p>
<p>Special case of last merge if local context.<br>
<embed src="images/LocalMerge_DiffRoots.svg" type="image/svg+xml"/></p>
<h2>Full-Context Merges</h2>
<p>These full-context merge operations are used when {@code rootIsWildcard}
is false.</p>
<p>Must keep all contexts; {@link #EMPTY} in array is a special value (and
null parent).<br>
<embed src="images/FullMerge_EmptyRoot.svg" type="image/svg+xml"/></p>
@param a the first {@link SingletonPredictionContext}
@param b the second {@link SingletonPredictionContext}
@param rootIsWildcard {@code true} if this is a local-context merge,
otherwise false to indicate a full-context merge
Handle case where at least one of {@code a} or {@code b} is {@link #EMPTY}. In the following diagrams, the symbol {@code $} is used to represent {@link #EMPTY}.
<h2>Local-Context Merges</h2>
<p>These local-context merge operations are used when {@code rootIsWildcard} is true.</p>
<p>{@link #EMPTY} is superset of any graph; return {@link #EMPTY}.<br> <embed src="images/LocalMerge_EmptyRoot.svg" type="image/svg+xml"/></p>
<p>{@link #EMPTY} and anything is {@code #EMPTY}, so merged parent is {@code #EMPTY}; return left graph.<br> <embed src="images/LocalMerge_EmptyParent.svg" type="image/svg+xml"/></p>
<p>Special case of last merge if local context.<br> <embed src="images/LocalMerge_DiffRoots.svg" type="image/svg+xml"/></p>
<h2>Full-Context Merges</h2>
<p>These full-context merge operations are used when {@code rootIsWildcard} is false.</p>
<p><embed src="images/FullMerge_EmptyRoots.svg" type="image/svg+xml"/></p>
<p>Must keep all contexts; {@link #EMPTY} in array is a special value (and null parent).<br> <embed src="images/FullMerge_EmptyRoot.svg" type="image/svg+xml"/></p>
<p><embed src="images/FullMerge_SameRoot.svg" type="image/svg+xml"/></p>
@param a the first {@link SingletonPredictionContext} @param b the second {@link SingletonPredictionContext} @param rootIsWildcard {@code true} if this is a local-context merge, otherwise false to indicate a full-context merge