public void testNoInitialResponseWhileRequired() throws Exception
    {
        // Setup test fixture.
        final String streamID = "example.org";

        when(session.getSessionData(SASLAuthentication.SASL_LAST_RESPONSE_WAS_PROVIDED_BUT_EMPTY)).thenReturn(null);

        // The following stubs are only used when the implementation under test progresses beyond the check for the
        // emptiness of the initial response. It should not progress beyond that point. I'm leaving the stubs in, for
        // the test to fail gracefully (rather than throw an exception) when the system under test misbehaves.
        when(session.getDefaultIdentity()).thenReturn(streamID);
        when(session.getConnection()).thenReturn(connection);
        saslAuthentication.when(() -> SASLAuthentication.verifyCertificates(any(), eq(streamID), anyBoolean())).thenReturn(true);

        final ExternalServerSaslServer server = new ExternalServerSaslServer(session);
        final byte[] input = new byte[]{};

        // Execute system under test.
        final byte[] response = server.evaluateResponse(input);

        // Verify results.
        assertNotNull(response);
        assertArrayEquals(new byte[0], response);
    }
Verify that when <em>no</em> initial response is given, a challenge (for authzid) is returned.

The absence of an initial response is represented by a null value being provided as the response to be evaluated,
while the provided session <em>does not</em> have this session attribute: {@link SASLAuthentication#SASL_LAST_RESPONSE_WAS_PROVIDED_BUT_EMPTY}
and @{SASLAuthentication#PROPERTY_SASL_EXTERNAL_SERVER_REQUIRE_AUTHZID} is <code>true</code>.
xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ExternalServerSaslServerTest.java