How can I replace assertions with if
s? Example:
public Wezel<Wartosc,Indeks> getWujek()
{
assert rodzic != null; // Root node has no uncle
assert rodzic.rodzic != null; // Children of root has no uncle
return rodzic.getBrat();
}
An assertion is roughly equivalent to:
if (!condition) {
throw new AssertionError();
}