### Question:
ConfigSecretReader { public static char[] readSecretFromConsole() { SystemAdapter.INSTANCE.out().println("Please enter the secret/password used to decrypt config value"); return PasswordReaderFactory.create().readPasswordFromConsole(); } private  ConfigSecretReader(); static Optional<char[]> readSecretFromFile(); static char[] readSecretFromConsole();  }### Answer:
@Test public void testReadFromConsole() { ByteArrayInputStream in = new ByteArrayInputStream("password".getBytes()); System.setIn(in); assertThat(ConfigSecretReader.readSecretFromConsole()).isEqualTo("password".toCharArray()); System.setIn(System.in); assertThat(ConfigSecretReader.readSecretFromConsole()).isEqualTo("".toCharArray()); }