CredentialInjector { public InterpreterResult hidePasswords(InterpreterResult ret) { if (ret == null) { return null; } return new InterpreterResult(ret.code(), replacePasswords(ret.message())); } CredentialInjector(UserCredentials creds); String replaceCredentials(String code); InterpreterResult hidePasswords(InterpreterResult ret);  }
@Test public void hidePasswordsNoResult() { UserCredentials userCredentials = mock(UserCredentials.class); CredentialInjector testee = new CredentialInjector(userCredentials); assertNull(testee.hidePasswords(null)); }