### Question:
B2StringUtil { public static boolean decimalNumberInRange(String str, int offset, int length, int minInclusive, int maxInclusive) { B2Preconditions.checkArgument(offset >= 0 && length >= 0); int value = 0; for (int i = offset; i < offset + length; i++) { char c = str.charAt(i); if (c < '0' || '9' < c) { return false; } value = (value * 10) + (c - '0'); } return (minInclusive <= value) && (value <= maxInclusive); } B2StringUtil(); static String percentEncode(String s); static String percentDecode(String s); static int decimalSubstringToInt(String s, int startIndex, int endIndex); static boolean decimalNumberInRange(String str, int offset, int length,
                                               int minInclusive, int maxInclusive); static String join(String delimiter, Object[] objects); static byte [] getUtf8Bytes(String str); static String toHexString(byte[] b); static String underscoresToCamelCase(String orig, boolean capitalizeFirstLetter); static boolean startsWithIgnoreCase(String all, String possiblePrefix); static final String UTF8; }### Answer:
@Test public void testDecimalNumberInRange() { assertTrue(decimalNumberInRange("a123b", 1, 3, 123, 123)); assertTrue(decimalNumberInRange("a123b", 1, 0, 0, 0)); assertTrue(decimalNumberInRange("a123b", 1, 1, 1, 1)); assertTrue(!decimalNumberInRange("a123b", 0, 4, 0, 1000)); assertTrue(!decimalNumberInRange("a123b", 1, 4, 0, 1000)); assertTrue(!decimalNumberInRange("a123b", 1, 3, 100, 122)); assertTrue(!decimalNumberInRange("a123b", 1, 3, 124, 200)); }