opposite static method
Returns LEFT if the position is RIGHT, RIGHT if the position is LEFT, or the position otherwise.
Implementation
static int opposite(int position) {
if (position == LEFT) return RIGHT;
if (position == RIGHT) return LEFT;
return position;
}