@Test public void throw_invalid_positiveNumber_exception_if_positiveNumber_is_empty_string() throws InvalidPositiveOrZeroNumberException { thrown.expect(InvalidPositiveOrZeroNumberException.class); PositiveOrZeroNumber positiveOrZeroNumber = PositiveOrZeroNumber.parse(""); }
public static PositiveOrZeroNumber parse(String positiveNumber) throws InvalidPositiveOrZeroNumberException { int numericValue; try { numericValue = Integer.parseInt(positiveNumber); } catch (NumberFormatException e) { throw new InvalidPositiveOrZeroNumberException(); } return new PositiveOrZeroNumber(numericValue); }
PositiveOrZeroNumber { public static PositiveOrZeroNumber parse(String positiveNumber) throws InvalidPositiveOrZeroNumberException { int numericValue; try { numericValue = Integer.parseInt(positiveNumber); } catch (NumberFormatException e) { throw new InvalidPositiveOrZeroNumberException(); } return new PositiveOrZeroNumber(numericValue); } }
PositiveOrZeroNumber { public static PositiveOrZeroNumber parse(String positiveNumber) throws InvalidPositiveOrZeroNumberException { int numericValue; try { numericValue = Integer.parseInt(positiveNumber); } catch (NumberFormatException e) { throw new InvalidPositiveOrZeroNumberException(); } return new PositiveOrZeroNumber(numericValue); } PositiveOrZeroNumber(int value); }
PositiveOrZeroNumber { public static PositiveOrZeroNumber parse(String positiveNumber) throws InvalidPositiveOrZeroNumberException { int numericValue; try { numericValue = Integer.parseInt(positiveNumber); } catch (NumberFormatException e) { throw new InvalidPositiveOrZeroNumberException(); } return new PositiveOrZeroNumber(numericValue); } PositiveOrZeroNumber(int value); static PositiveOrZeroNumber parse(String positiveNumber); int getValue(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
PositiveOrZeroNumber { public static PositiveOrZeroNumber parse(String positiveNumber) throws InvalidPositiveOrZeroNumberException { int numericValue; try { numericValue = Integer.parseInt(positiveNumber); } catch (NumberFormatException e) { throw new InvalidPositiveOrZeroNumberException(); } return new PositiveOrZeroNumber(numericValue); } PositiveOrZeroNumber(int value); static PositiveOrZeroNumber parse(String positiveNumber); int getValue(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }