How does change in price of a substitute good affect the demand of the given good?

How does change in price of a substitute good affect the demand of the given good? Explain with the help of an example.

(i) In case of substitute goods, increase in the price of one good results in increase in the demand of its substitute goods, e.g. tea and coffee are substitute goods. When the price of tea increases, then consumer starts consuming coffee in place of tea.
As a result, demand of coffee increases and demand curve of coffee shifts to the right.

(ii) In case of substitute goods, decrease in the price of one good results decrease in the demand of its substitute goods, e.g. tea and coffee are substitutes goods. When price of coffee decreases, then consumer starts consuming more coffee in place of tea. As a result, demand of tea decreases and demand curve of tea shifts to the left.