code: protected boolean checkState(final State[] validStates) {
          for (final State cur : validStates) {
              if (cur == getState()) {
                  return true;
              }
          }
          return false;
      }
docs: Checks if this writer's current state is in the list of given states.
  
  @param validStates an array of {@code State}s to compare this writer's state to.
  @return true if this writer's state is in the given list.