### Question:
RegisterParams { Credentials getEth1Credentials() { if (eth1PrivateKeyOptions.eth1PrivateKey != null) { return Credentials.create(eth1PrivateKeyOptions.eth1PrivateKey); } else if (eth1PrivateKeyOptions.keystoreOptions != null) { return getEth1CredentialsFromKeystore(); } else { throw new IllegalStateException("Eth1 Private Key Options are not initialized"); } } RegisterParams(); @VisibleForTesting  RegisterParams(
      final CommandSpec commandSpec,
      final Eth1PrivateKeyOptions eth1PrivateKeyOptions,
      final IntConsumer shutdownFunction,
      final ConsoleAdapter consoleAdapter); RegisterAction createRegisterAction(final boolean verboseOutputEnabled);  }### Answer:
@Test void eth1PrivateKeyReturnsCredential() { final Eth1PrivateKeyOptions eth1PrivateKeyOptions = new Eth1PrivateKeyOptions(); eth1PrivateKeyOptions.eth1PrivateKey = ETH1_PRIVATE_KEY; final RegisterParams registerParams = new RegisterParams(commandSpec, eth1PrivateKeyOptions, SHUTDOWN_FUNCTION, consoleAdapter); final Credentials eth1Credentials = registerParams.getEth1Credentials(); assertThat(eth1Credentials.getEcKeyPair()).isEqualTo(EXPECTED_EC_KEYPAIR); }
@Test void eth1EncryptedKeystoreReturnsCredential(@TempDir final Path tempDir) throws IOException, CipherException { final String keystoreFileName = WalletUtils.generateWalletFile(PASSWORD, EXPECTED_EC_KEYPAIR, tempDir.toFile(), true); final File keystoreFile = tempDir.resolve(keystoreFileName).toFile(); final File passwordFile = Files.writeString(tempDir.resolve("password.txt"), "test123").toFile(); final Eth1PrivateKeyOptions.Eth1EncryptedKeystoreOptions keystoreOptions = new Eth1PrivateKeyOptions.Eth1EncryptedKeystoreOptions(); keystoreOptions.eth1KeystoreFile = keystoreFile; keystoreOptions.eth1KeystorePasswordFile = passwordFile; final Eth1PrivateKeyOptions eth1PrivateKeyOptions = new Eth1PrivateKeyOptions(); eth1PrivateKeyOptions.keystoreOptions = keystoreOptions; final RegisterParams registerParams = new RegisterParams(commandSpec, eth1PrivateKeyOptions, SHUTDOWN_FUNCTION, consoleAdapter); final Credentials eth1Credentials = registerParams.getEth1Credentials(); assertThat(eth1Credentials.getEcKeyPair()).isEqualTo(EXPECTED_EC_KEYPAIR); }