@Test
public void testConvertStringSidToBinary() throws Exception {

    byte[] expectedSid = {(byte) 0x01, (byte) 0x05, (byte) 0x00, (byte) 0x00,
            (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x05,
            (byte) 0x15, (byte) 0x00, (byte) 0x00, (byte) 0x00,
            (byte) 0xe9, (byte) 0x67, (byte) 0xbb, (byte) 0x98,
            (byte) 0xd6, (byte) 0xb7, (byte) 0xd7, (byte) 0xbf,
            (byte) 0x82, (byte) 0x05, (byte) 0x1e, (byte) 0x6c,
            (byte) 0x28, (byte) 0x06, (byte) 0x00, (byte) 0x00};
    byte[] result = LdapUtils.convertStringSidToBinary("S-1-5-21-2562418665-3218585558-1813906818-1576");
    assertThat(ArrayUtils.isSameLength(expectedSid, result)).as("incorrect length of array").isTrue();
    for (int i = 0; i < result.length; i++) {
        assertThat(expectedSid[i]).isEqualTo(result[i]);
    }
}