Skip to main content

Practice · 3 of 3

Optional at the boundary

CHALLENGE
Difficulty: advanced+25 XP

Write parsePort(String input): return Optional of the parsed port when input is a valid number in 1..65535; Optional.empty() otherwise (null, blank, non-numeric, or out of range).

Back to lesson: Practice: Practice: Pipelines at Work