package se.ericthelin.fractions;

import static java.util.Objects.requireNonNull;

public class Fraction {

	public static Fraction of(String text) {
		return new Fraction(text);
	}

	private final String text;

	private Fraction(String text) {
		this.text = requireNonNull(text);
	}

	@Override
	public String toString() {
		return text;
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Fraction)) {
			return false;
		}

		Fraction other = (Fraction) obj;

		return text.equals(other.text);
	}

	public Fraction plus(Fraction term) {
		throw new UnsupportedOperationException("Not yet implemented");
	}
}

@@ -384,16 +384,58 @@
  obj) %7B%0A
+%09%09if (obj == this) %7B%0A%09%09%09return true;%0A%09%09%7D%0A%0A
 %09%09if (!(

Optimize equals check for same instance