A $2$ by $2$ square is divided into four $1$ by $1$ squares.  Each of the small squares is to be painted either green or red.  In how many different ways can the painting be accomplished so that no green square shares its top or right side with any red square?  There may be as few as zero or as many as four small green squares.
$\text{(A)}\  4 \qquad \text{(B)}\ 6 \qquad \text{(C)}\ 7 \qquad \text{(D)}\ 8 \qquad \text{(E)}\ 16$
If a green square cannot share its top or right side with a red square, then a red square can not share its bottom or left side with a green square. Let us split this up into several cases.
Case 1: There are no green squares. This can be done in $1$ way.
Case 2: There is one green square and three red squares. This can only be done when the green square's top and right edges are against the edge, so there is $1$ way.
Case 3: There are two green squares and two red squares. This happens when the two green squares are in the two top squares or two right squares, so there are $2$ ways.
Case 4: There are three green squares and one red square. Similar to case 2, this happens when the red square's left and bottom edges are against the edge, so there is $1$ way.
Case 5: There are four green squares and zero red squares.   $1$ way.
\[1+1+2+1+1 = \boxed{\text{(B)}\ 6}\]