### Question:
OptionParser { public static Range<Long> parseLongRange(final String arg) { checkArgument(arg.matches("-?\\d+\\.\\.-?\\d+")); final Iterator<String> ends = Splitter.on("..").split(arg).iterator(); return Range.closed(parseLong(ends.next()), parseLong(ends.next())); }  static Range<Long> parseLongRange(final String arg); static long parseLong(final String arg); static String format(final Range<Long> range); static String format(final int value); static String format(final long value); static String format(final float value); static String format(final UInt256 value);  }### Answer:
@Test public void parseLongRange_negative() { final String input = "-11..-5"; final Range<Long> expected = Range.closed(-11L, -5L); assertThat(OptionParser.parseLongRange(input)).isEqualTo(expected); }
@Test public void parseLongRange_positive() { final String input = "11..22"; final Range<Long> expected = Range.closed(11L, 22L); assertThat(OptionParser.parseLongRange(input)).isEqualTo(expected); }
@Test public void parseLongRange_spanningZero() { final String input = "-11..22"; final Range<Long> expected = Range.closed(-11L, 22L); assertThat(OptionParser.parseLongRange(input)).isEqualTo(expected); }
@Test public void parseLongRange_singleElement() { final String input = "1..1"; final Range<Long> expected = Range.closed(1L, 1L); assertThat(OptionParser.parseLongRange(input)).isEqualTo(expected); }
@Test public void parseLongRange_outOfOrderBounds() { final String input = "2..1"; assertThatThrownBy(() -> OptionParser.parseLongRange(input)) .isInstanceOf(IllegalArgumentException.class); }