@Test public void fractionに28とマイナス44を渡すとネガティブ() { Fraction fraction = fraction(28, -44); assertTrue(fraction.isNegative()); }
@Contract("_ -> !null") public static Fraction fraction(long num) { return new Fraction(num); }
Fraction { @Contract("_ -> !null") public static Fraction fraction(long num) { return new Fraction(num); } }
Fraction { @Contract("_ -> !null") public static Fraction fraction(long num) { return new Fraction(num); } private  Fraction(long numerator); private  Fraction(long numerator, long denominator); }
Fraction { @Contract("_ -> !null") public static Fraction fraction(long num) { return new Fraction(num); } private  Fraction(long numerator); private  Fraction(long numerator, long denominator); @Contract("_ -> !null") static Fraction fraction(long num); static Fraction fraction(long num, long den); @Contract(pure = true) long getSignedNumerator(); boolean isNegative(); @NotNull @Contract("_ -> !null") Fraction plus(long number); @NotNull @Contract("null -> fail") Fraction plus(Fraction fr); @Contract(pure = true) @Override String toString(); @Contract("null -> false") @Override boolean equals(Object o); @Override int hashCode(); }
Fraction { @Contract("_ -> !null") public static Fraction fraction(long num) { return new Fraction(num); } private  Fraction(long numerator); private  Fraction(long numerator, long denominator); @Contract("_ -> !null") static Fraction fraction(long num); static Fraction fraction(long num, long den); @Contract(pure = true) long getSignedNumerator(); boolean isNegative(); @NotNull @Contract("_ -> !null") Fraction plus(long number); @NotNull @Contract("null -> fail") Fraction plus(Fraction fr); @Contract(pure = true) @Override String toString(); @Contract("null -> false") @Override boolean equals(Object o); @Override int hashCode();  }