@Test(expected = IllegalArgumentException.class) public void exception_thrown_when_range_is_invalid() { Range.from(RANGE_END, RANGE_START); }
public static Range from(@IntRange(from = 0) int start, @IntRange(from = 0) int end) { if (end < start) { throw new IllegalArgumentException("The end of the targetRange shouldn't be before the start"); } return new Range(start, end); }
Range implements Locator { public static Range from(@IntRange(from = 0) int start, @IntRange(from = 0) int end) { if (end < start) { throw new IllegalArgumentException("The end of the targetRange shouldn't be before the start"); } return new Range(start, end); } }
Range implements Locator { public static Range from(@IntRange(from = 0) int start, @IntRange(from = 0) int end) { if (end < start) { throw new IllegalArgumentException("The end of the targetRange shouldn't be before the start"); } return new Range(start, end); } private  Range(int start, int end); }
Range implements Locator { public static Range from(@IntRange(from = 0) int start, @IntRange(from = 0) int end) { if (end < start) { throw new IllegalArgumentException("The end of the targetRange shouldn't be before the start"); } return new Range(start, end); } private  Range(int start, int end); static Range from(@IntRange(from = 0) int start, @IntRange(from = 0) int end); @NonNull @Override List<TargetRange> locate(@NonNull String content); }
Range implements Locator { public static Range from(@IntRange(from = 0) int start, @IntRange(from = 0) int end) { if (end < start) { throw new IllegalArgumentException("The end of the targetRange shouldn't be before the start"); } return new Range(start, end); } private  Range(int start, int end); static Range from(@IntRange(from = 0) int start, @IntRange(from = 0) int end); @NonNull @Override List<TargetRange> locate(@NonNull String content);  }