public Optional<String> identityFromSignature(final String password) {
    // for some generators, identity in the clear is just not a part of the password
    if (!prependUsername || shouldDeriveUsername() || StringUtils.isBlank(password)) {
      return Optional.empty();
    }
    // checking for the case of unexpected format
    if (StringUtils.countMatches(password, DELIMITER) == 2) {
      if (usernameIsTimestamp()) {
        final int indexOfSecondDelimiter = password.indexOf(DELIMITER, password.indexOf(DELIMITER) + 1);
        return Optional.of(password.substring(0, indexOfSecondDelimiter));
      } else {
        return Optional.of(password.substring(0, password.indexOf(DELIMITER)));
      }
    }
    return Optional.empty();
  }
@Test
  public void testGetIdentityFromSignature() {
    final String identity = standardGenerator.identityFromSignature(standardCredentials.password()).orElseThrow();
    assertEquals(E164, identity);
  }