import java.awt.geom.Line2D;
public class Main {
/**
* Compares two lines are returns true
if they are equal or
* both null
.
*
* @param l1 the first line (null
permitted).
* @param l2 the second line (null
permitted).
*
* @return A boolean.
*/
public static boolean equal(final Line2D l1, final Line2D l2) {
if (l1 == null) {
return (l2 == null);
}
if (l2 == null) {
return false;
}
if (!l1.getP1().equals(l2.getP1())) {
return false;
}
if (!l1.getP2().equals(l2.getP2())) {
return false;
}
return true;
}
}