protected void doneInternal(){
  if (states.size() > 0)   throw new JsonWriterException("Unclosed JSON objects and/or arrays when closing writer");
  if (first)   throw new JsonWriterException("Nothing was written to the JSON writer");
}

protected void doneInternal ( ) { if ( states . size ( ) > 0 ) throw new JsonWriterException ( "Unclosed JSON objects and/or arrays when closing writer" ) ; if ( first ) throw new JsonWriterException ( "Nothing was written to the JSON writer" ) ; }
ensures that the object is in the finished state .
