### Question:
DnKeyFormat { static int findDNKeyParent(ByteSequence dnKey) { if (dnKey.length() == 0) { return -1; } for (int i = dnKey.length() - 1; i >= 0; i--) { if (positionIsRDNSeparator(dnKey, i)) { return i; } } return 0; }    }### Answer:
@Test(dataProvider="findDnKeyParentData") public void testFindDnKeyParent(String dn, int expectedLength) throws Exception { ensureServerIsUpAndRunning(); ByteString dnKey = DnKeyFormat.dnToDNKey(DN.valueOf(dn), 0); assertThat(DnKeyFormat.findDNKeyParent(dnKey)).isEqualTo(expectedLength); }