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