public CommandTester thenExpect(String expected, boolean checkPermissions) {
        String actual = this.renderBuffer();
        assertEquals(expected.trim(), actual.trim());

        if (checkPermissions && this.permissions != null) {
            assertEquals(this.checkedPermissions, this.permissions.keySet());
        }

        return this.clearMessageBuffer();
    }
Asserts that the current contents of the message buffer matches the given input string.

@param expected the expected contents
@param checkPermissions whether to assert that the exact permissions were checked
@return this
standalone/src/test/java/me/lucko/luckperms/standalone/utils/CommandTester.java