@Test public void testIsLessThan() { Assert.assertTrue(IntArrayComparator.isLessThan(null, this.base)); Assert.assertTrue(IntArrayComparator.isLessThan(this.lessThanBase, this.base)); Assert.assertTrue( IntArrayComparator.isLessThan(ArrayConstants.ZERO_LENGTH_INT_ARRAY, this.base)); Assert.assertFalse(IntArrayComparator.isLessThan(this.base, null)); Assert.assertFalse(IntArrayComparator.isLessThan(this.base, this.lessThanBase)); Assert.assertFalse( IntArrayComparator.isLessThan(this.base, ArrayConstants.ZERO_LENGTH_INT_ARRAY)); Assert.assertFalse(IntArrayComparator.isLessThan(this.base, this.equalToBaseButNotSame)); Assert.assertFalse(IntArrayComparator.isLessThan(null, null)); Assert.assertFalse(IntArrayComparator.isLessThan(this.base, this.equalToBaseButNotSame)); }
@Test public void testComplementProblem() { final int[] twoComplementProblemLesser = new int[this.base.length]; final int[] twoComplementProblemGreater = new int[this.base.length]; System.arraycopy(this.base, 0, twoComplementProblemLesser, 0, this.base.length); System.arraycopy(this.base, 0, twoComplementProblemGreater, 0, this.base.length); twoComplementProblemLesser[1] = 100; twoComplementProblemGreater[1] = -100; Assert.assertTrue( IntArrayComparator.isLessThan(twoComplementProblemLesser, twoComplementProblemGreater)); }