@Test
public void startRegistrationShouldReturnARandomChallenge() throws U2fBadInputException, U2fBadConfigurationException {

    DeviceRegistration deviceRegistration = new DeviceRegistration(KEY_HANDLE_BASE64, USER_PUBLIC_KEY_SIGN_HEX, ATTESTATION_CERTIFICATE, 0);
    RegisterRequestData data = u2f.startRegistration("example.com", ImmutableList.of(deviceRegistration));
    RegisterRequestData data2 = u2f.startRegistration("example.com", ImmutableList.of(deviceRegistration));
    assertEquals(1, data.getRegisterRequests().size());
    assertEquals(1, data2.getRegisterRequests().size());
    assertNotEquals(
        "startRegistration must not return the same challenge twice in a row.",
        data.getRegisterRequests().get(0).getChallenge(),
        data2.getRegisterRequests().get(0).getChallenge()
    );
}