### Question:
CompositeUtils { public static String decrementBound(String orig) { int[] codePoints = orig.codePoints().toArray(); int length = codePoints.length; int lastCodePoint = codePoints[length - 1]; while (lastCodePoint == Character.MIN_CODE_POINT) { if (length == 1) throw new RuntimeException("Cannot decrement bound without decreasing the number of characters."); codePoints[length - 1] = Character.MAX_CODE_POINT; lastCodePoint = codePoints[--length - 1]; } while (!Character.isValidCodePoint(--lastCodePoint)) ; codePoints[length - 1] = lastCodePoint; StringBuilder sb = new StringBuilder(); for (int i = 0; i < codePoints.length; i++) sb.appendCodePoint(codePoints[i]); return sb.toString(); }  static Map<String,DiscreteIndexType<?>> getFieldToDiscreteIndexTypeMap(Multimap<String,?> fieldDatatypes); static String getInclusiveLowerBound(String lowerBound, DiscreteIndexType discreteIndexType); static String getExclusiveLowerBound(String lowerBound, DiscreteIndexType discreteIndexType); static String getInclusiveUpperBound(String upperBound, DiscreteIndexType discreteIndexType); static String getExclusiveUpperBound(String upperBound, DiscreteIndexType discreteIndexType); static String decrementBound(String orig); static String incrementBound(String orig); static final Set<Class<?>> ALL_VALID_LEAF_NODE_CLASSES; static final Set<Class<?>> UNBOUNDED_RANGE_NODE_CLASSES; }### Answer:
@Test public void decrementTest() { String start = "073940"; String finish = "07393c"; List<String> result = new ArrayList<>(); for (String next = start; next.compareTo(finish) >= 0; next = CompositeUtils.decrementBound(next)) { if (isValidHex(next)) result.add(next); } Assert.assertEquals(5, result.size()); Assert.assertEquals("073940", result.get(0)); Assert.assertEquals("07393f", result.get(1)); Assert.assertEquals("07393e", result.get(2)); Assert.assertEquals("07393d", result.get(3)); Assert.assertEquals("07393c", result.get(4)); }
@Test(expected = RuntimeException.class) public void decrementMinString() { StringBuilder builder = new StringBuilder(); for (int i = 0; i < 10; i++) builder.appendCodePoint(Character.MIN_CODE_POINT); String minString = builder.toString(); CompositeUtils.decrementBound(minString); }