private void throwIfNotComplete() {
    if (!completed) {
      throw new IllegalStateException("PLAIN authentication not completed");
    }
  }
This class was copied from Hadoop Common (3.1.2) and subsequently modified.
hbase-examples/src/main/java/org/apache/hadoop/hbase/security/provider/example/SaslPlainServer.java