@Test( expected = IllegalArgumentException.class ) public void hasSizeOfAtMostShouldThrowExceptionIfArraySizeIsLargerThanSuppliedValue() { CheckArg.hasSizeOfAtMost(new Object[] {"key", "value"}, 1, "value"); }
@Test( expected = IllegalArgumentException.class ) public void hasSizeOfAtMostShouldThrowExceptionIfMapSizeIsLargerThanSuppliedValue() { CheckArg.hasSizeOfAtMost(Collections.singletonMap("key", "value"), 0, "value"); }
@Test public void hasSizeOfAtMostShouldNotThrowExceptionIfMapSizeIsEqualToSuppliedValue() { CheckArg.hasSizeOfAtMost(Collections.singletonMap("key", "value"), 1, "value"); }
@Test( expected = IllegalArgumentException.class ) public void hasSizeOfAtMostShouldThrowExceptionIfCollectionSizeIsLargerThanSuppliedValue() { CheckArg.hasSizeOfAtMost(Collections.singletonList(" "), 0, "value"); }
@Test public void hasSizeOfAtMostShouldNotThrowExceptionIfArraySizeIsGreaterThanSuppliedValue() { CheckArg.hasSizeOfAtMost(new Object[] {"key", "value"}, 3, "value"); }
@Test public void hasSizeOfAtMostShouldNotThrowExceptionIfCollectionSizeIsEqualToSuppliedValue() { CheckArg.hasSizeOfAtMost(Collections.singletonList(" "), 1, "value"); }
@Test public void hasSizeOfAtMostShouldNotThrowExceptionIfCollectionSizeIsGreaterThanSuppliedValue() { CheckArg.hasSizeOfAtMost(Collections.singletonList(" "), 2, "value"); }
@Test public void hasSizeOfAtMostShouldNotThrowExceptionIfMapSizeIsGreaterThanSuppliedValue() { CheckArg.hasSizeOfAtMost(Collections.singletonMap("key", "value"), 2, "value"); }
@Test public void hasSizeOfAtMostShouldNotThrowExceptionIfArraySizeIsEqualToSuppliedValue() { CheckArg.hasSizeOfAtMost(new Object[] {"key", "value"}, 2, "value"); }
if ("addNode".equals(methodName)) { CheckArg.hasSizeOfAtLeast(arguments, 1, "arguments"); CheckArg.hasSizeOfAtMost(arguments, 2, "arguments"); CheckArg.isInstanceOf(arguments[0], String.class, "arguments[0]");
if ("addNode".equals(methodName)) { CheckArg.hasSizeOfAtLeast(arguments, 1, "arguments"); CheckArg.hasSizeOfAtMost(arguments, 2, "arguments"); CheckArg.isInstanceOf(arguments[0], String.class, "arguments[0]");