code: private void sendChangeCipherAndFinish(boolean finishedTag)
              throws IOException {
  
          output.flush();
  
          Finished mesg = new Finished(protocolVersion, handshakeHash,
              Finished.SERVER, session.getMasterSecret(), cipherSuite);
  
          /*
           * Send the change_cipher_spec record; then our Finished handshake
           * message will be the last handshake message.  Flush, and now we
           * are ready for application data!!
           */
          sendChangeCipherSpec(mesg, finishedTag);
  
          /*
           * save server verify data for secure renegotiation
           */
          if (secureRenegotiation) {
              serverVerifyData = mesg.getVerifyData();
          }
  
          /*
           * Update state machine so client MUST send 'finished' next
           * The update should only take place if it is not in the fast
           * handshake mode since the server has to wait for a finished
           * message from the client.
           */
          if (finishedTag) {
              state = HandshakeMessage.ht_finished;
          }
      }
docs: /*
  Compute finished message with the "server" digest (and then forget
  about that digest, it can't be used again).