### Question:
WhitelistOptionParser { WhitelistOperation parseWhitelistOperation(String inputOption) { String normalizedInput = normalizeUserInput(inputOption); if (normalizedInput.startsWith(GRANT_PREFIX)) { return WhitelistOperation.GRANT; } else if (normalizedInput.startsWith(REVOKE_PREFIX)) { return WhitelistOperation.REVOKE; } else if (normalizedInput.equals(DROP_LEGACY_KEY_PATTERN)) { return WhitelistOperation.DROP_LEGACY; } else { throw new InvalidRequestException("Invalid whitelist operation option: " + inputOption); } }    }### Answer:
@Test public void testParseWhitelistOperationGrant() { WhitelistOperation operation = parser.parseWhitelistOperation("grant_audit_whitelist_for_select"); assertThat(operation).isEqualTo(WhitelistOperation.GRANT); }
@Test public void testParseWhitelistOperationRevoke() { WhitelistOperation operation = parser.parseWhitelistOperation("revoke_audit_whitelist_for_modify"); assertThat(operation).isEqualTo(WhitelistOperation.REVOKE); }
@Test public void testParseWhitelistUppercaseAndSpace() { WhitelistOperation operation = parser.parseWhitelistOperation("REVOKE AUDIT WHITELIST FOR MODIFY"); assertThat(operation).isEqualTo(WhitelistOperation.REVOKE); }
@Test public void testParseDropLegacy() { WhitelistOperation operation = parser.parseWhitelistOperation("DROP LEGACY AUDIT WHITELIST TABLE"); assertThat(operation).isEqualTo(WhitelistOperation.DROP_LEGACY); }
@Test public void testParseWhitelistOperationFoo() { assertThatExceptionOfType(InvalidRequestException.class) .isThrownBy(() -> parser.parseWhitelistOperation("foo_audit_whitelist_for_select")); }