Location { public static Location create(final String path, final int line) { validateLine(line); return new Location(path, line, NO_COLUMN); } private  Location(final String path, final int line, final int column); private  Location(final Builder builder); static Location create(final String path, final int line); static Location create(final String path, final int line, final int column); String getPath(); int getLine(); int getColumn(); @Generated(value = "org.eclipse.Eclipse") @Override int hashCode(); @Generated(value = "org.eclipse.Eclipse") @Override boolean equals(final Object obj); @Override String toString(); static Builder builder(); static final int NO_LINE; static final int NO_COLUMN; }
@Test void testCreateLocationWithNegativeLineFails() { assertThrows(IllegalArgumentException.class, () -> Location.create(PATH, -1)); }
@Test void testCreateLocationWithNegativeLineFails2() { assertThrows(IllegalArgumentException.class, () -> Location.create(PATH, -1, 1)); }
@Test void testCreateLocationWithNegativeColumnFails() { assertThrows(IllegalArgumentException.class, () -> Location.create(PATH, 1, -1)); }