### Question:
QueryParamParser { public static LocalTime parseLocalTime(MultiValueMap<String, String> params, String key, LocalTime defaultValue) { return parseLocalTime(getFirstValue(params, key), defaultValue); }  static Pageable parsePageRequest(MultiValueMap<String, String> params); static Pageable parsePageRequest(MultiValueMap<String, String> params, Sort defaultSort, int defaultPageSize, int maxPageSize); static Pageable parsePageRequest(MultiValueMap<String, String> params, String pageSizeKey, String pageKey, String sortKey, Sort defaultSort, int defaultPageSize, int maxPageSize); static Sort parseSort(MultiValueMap<String, String> params, String key); static Sort parseSort(MultiValueMap<String, String> params, String key, Sort defaultSort); static Integer parseInteger(MultiValueMap<String, String> params, String key, Integer defaultValue); static Integer parseInteger(String value, Integer defaultValue); static Long parseLong(MultiValueMap<String, String> params, String key, Long defaultValue); static Long parseLong(String value, Long defaultValue); static Boolean parseBoolean(MultiValueMap<String, String> params, String key, Boolean defaultValue); static Boolean parseBoolean(String value, Boolean defaultValue); static LocalDate parseLocalDate(MultiValueMap<String, String> params, String key, LocalDate defaultValue); static LocalDate parseLocalDate(String value, LocalDate defaultValue); static LocalTime parseLocalTime(MultiValueMap<String, String> params, String key, LocalTime defaultValue); static LocalTime parseLocalTime(String value, LocalTime defaultValue); static LocalDateTime parseLocalDateTime(MultiValueMap<String, String> params, String key, LocalDateTime defaultValue); static LocalDateTime parseLocalDateTime(String value, LocalDateTime defaultValue); static Instant parseInstant(MultiValueMap<String, String> params, String key, Instant defaultValue); static Instant parseInstant(String value, Instant defaultValue); static T parseEnum(MultiValueMap<String, String> params, String key, Class<T> clazz, T defaultValue); static T parseEnum(String value, Class<T> clazz, T defaultValue); static Set<T> parseEnumSet(MultiValueMap<String, String> params, String key, Class<T> clazz, Set<T> defaultValue); static List<DateTimeFormatter> DEFAULT_DATE_FORMATTERS; }### Answer:
@Test public void parseLocalTime() { MultiValueMap map = new LinkedMultiValueMap<String, String>(); LocalTime time = LocalTime.of(10, 15, 33); map.add("v1", "10:15"); map.add("v2", "10:15:33"); map.add("invalid", "121234"); LocalTime v1 = QueryParamParser.parseLocalTime(map, "v1", null); LocalTime v2 = QueryParamParser.parseLocalTime(map, "v2", null); LocalTime invalid = QueryParamParser.parseLocalTime(map, "invalid", null); LocalTime defaultValue = LocalTime.now(); LocalTime invalidWithDefault = QueryParamParser.parseLocalTime(map, "invalid", defaultValue); assertThat(v1, equalTo(time.withSecond(0))); assertThat(v2, equalTo(time)); assertThat(invalid, nullValue()); assertThat(invalidWithDefault, equalTo(defaultValue)); }