/**
  * Asserts that the state of this instance will remain consistent if a specific
  * <tt>MediaDirection</tt> (i.e. <tt>direction</tt>) and a <tt>MediaDevice</tt> with a specific
  * <tt>MediaDirection</tt> (i.e. <tt>deviceDirection</tt>) are both set on this instance.
  *
  * @param direction the <tt>MediaDirection</tt> to validate against the specified
  *     <tt>deviceDirection</tt>
  * @param deviceDirection the <tt>MediaDirection</tt> of a <tt>MediaDevice</tt> to validate
  *     against the specified <tt>direction</tt>
  * @param illegalArgumentExceptionMessage the message of the <tt>IllegalArgumentException</tt> to
  *     be thrown if the state of this instance would've been compromised if <tt>direction</tt> and
  *     the <tt>MediaDevice</tt> associated with <tt>deviceDirection</tt> were both set on this
  *     instance
  * @throws IllegalArgumentException if the state of this instance would've been compromised were
  *     both <tt>direction</tt> and the <tt>MediaDevice</tt> associated with
  *     <tt>deviceDirection</tt> set on this instance
  */
 protected void assertDirection(
     MediaDirection direction,
     MediaDirection deviceDirection,
     String illegalArgumentExceptionMessage)
     throws IllegalArgumentException {
   if ((direction != null) && !direction.and(deviceDirection).equals(direction))
     throw new IllegalArgumentException(illegalArgumentExceptionMessage);
 }