@Test public void testEqualsWithNull() { Span a = new Span(0, 0); assertFalse(a.equals(null)); }
@Override public boolean equals(Object o) { if (o == null) { return false; } if (!(o instanceof Span)) { return false; } Span span = (Span) o; if (getStart() != span.getStart()) { return false; } return getLength() == span.getLength(); }
Span implements Comparable<Span> { @Override public boolean equals(Object o) { if (o == null) { return false; } if (!(o instanceof Span)) { return false; } Span span = (Span) o; if (getStart() != span.getStart()) { return false; } return getLength() == span.getLength(); } }
Span implements Comparable<Span> { @Override public boolean equals(Object o) { if (o == null) { return false; } if (!(o instanceof Span)) { return false; } Span span = (Span) o; if (getStart() != span.getStart()) { return false; } return getLength() == span.getLength(); } Span(int start, int length); }
Span implements Comparable<Span> { @Override public boolean equals(Object o) { if (o == null) { return false; } if (!(o instanceof Span)) { return false; } Span span = (Span) o; if (getStart() != span.getStart()) { return false; } return getLength() == span.getLength(); } Span(int start, int length); int getStart(); int getLength(); int getEnd(); boolean isContaining(Span containingSpan); boolean isIntersecting(Span s); @Override int compareTo(Span span); @Override boolean equals(Object o); @Override String toString(); @Override int hashCode(); }
Span implements Comparable<Span> { @Override public boolean equals(Object o) { if (o == null) { return false; } if (!(o instanceof Span)) { return false; } Span span = (Span) o; if (getStart() != span.getStart()) { return false; } return getLength() == span.getLength(); } Span(int start, int length); int getStart(); int getLength(); int getEnd(); boolean isContaining(Span containingSpan); boolean isIntersecting(Span s); @Override int compareTo(Span span); @Override boolean equals(Object o); @Override String toString(); @Override int hashCode();  }