IdempotentUtils { @Deprecated @SdkProtectedApi public static String resolveString(String token) { return token != null ? token : generator.get(); }  @Deprecated @SdkProtectedApi static String resolveString(String token); @SdkProtectedApi static DefaultValueSupplier<String> getGenerator(); @SdkTestInternalApi static void setGenerator(DefaultValueSupplier<String> newGenerator);  }
@Test public void resolveString_returns_givenString_when_nonnullString_is_passed() { String idempotencyToken = "120c7d4a-e982-4323-a53e-28989a0a9f26"; assertEquals(idempotencyToken, IdempotentUtils.resolveString(idempotencyToken)); }
@Test public void resolveString_returns_emptyString_when_emptyString_is_passed() { String idempotencyToken = ""; assertEquals(idempotencyToken, IdempotentUtils.resolveString(idempotencyToken)); }
@Test public void resolveString_returns_newUniqueToken_when_nullString_is_passed() { assertNotNull(IdempotentUtils.resolveString(null)); }