Code example for AuthenticationException

0
                    ntcredentials.getDomain(), 
                    ntcredentials.getWorkstation(),
                    this.challenge);
            this.state = State.MSG_TYPE3_GENERATED;
        } else { 
            throw new AuthenticationException("Unexpected state: " + this.state);
        } 
        CharArrayBuffer buffer = new CharArrayBuffer(32);
        if (isProxy()) {
            buffer.append(AUTH.PROXY_AUTH_RESP);
        } else { 
            buffer.append(AUTH.WWW_AUTH_RESP);
        } 
        buffer.append(": NTLM ");
        buffer.append(response);
        return new BufferedHeader(buffer);
    } 
 
    public boolean isComplete() { 
        return this.state == State.MSG_TYPE3_GENERATED || this.state == State.FAILED;
Connect your IDE to all the code out there  Get Codota for Java