### Question:
SegmentTreeSum { public void addValue(int left, int right, long value) { if (left < 0 || right > size) { throw new IllegalArgumentException( "Input left and round bounds should be between zero and segment tree size"); } if (right <= left) { throw new IllegalArgumentException( "Input right bound should be greater than left bound"); } addValue(left, right, value, 0, 0, size); } SegmentTreeSum(int size); void addValue(int left, int right, long value); long getSum(int left, int right);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testSegmentTreeSumIncorrectBounds1() { SegmentTreeSum tree = new SegmentTreeSum(100); tree.addValue(-1, 10, 100); }
@Test(expected = IllegalArgumentException.class) public void testSegmentTreeSumIncorrectBounds2() { SegmentTreeSum tree = new SegmentTreeSum(100); tree.addValue(1, 101, 10); }
@Test(expected = IllegalArgumentException.class) public void testSegmentTreeSumIncorrectBounds3() { SegmentTreeSum tree = new SegmentTreeSum(100); tree.addValue(10, 10, 101); }