CoreFunctions implements BuiltinProvider { public static void substring(final TextNode result, final TextNode input, final IntNode from, final IntNode to) { final String string = input.getTextValue(); final int fromPos = resolveIndex(from.getIntValue(), string.length()); final int toPos = resolveIndex(to.getIntValue(), string.length()); result.setValue(string.substring(fromPos, toPos)); }  static IArrayNode add(@SuppressWarnings("unused") final IArrayNode result, final IArrayNode array, final IJsonNode node, final IntNode index); static void camelCase(final TextNode result, final TextNode input); static void concat(final TextNode result, final IJsonNode... params); static IJsonNode extract(final IJsonNode result, final TextNode input, final TextNode pattern); static IJsonNode extract(final IJsonNode result, final TextNode input, final TextNode pattern,
			final IJsonNode defaultValue); static IJsonNode filter(final ArrayNode result, final IArrayNode input, final IJsonNode... elementsToFilter); static void format(final TextNode result, final TextNode format, final IJsonNode... params); static void length(final IntNode result, final TextNode node); static void replace(final TextNode result, final TextNode input, final TextNode search,
			final TextNode replace); static void split(final ArrayNode result, final TextNode input, final TextNode splitString); static void substring(final TextNode result, final TextNode input, final IntNode from, final IntNode to); static void trim(final TextNode result, final TextNode input); static void unionAll(final ArrayNode union, final IJsonNode... arrays); @Name(verb = "concat", noun = "concatenation")
	static final Aggregation<IJsonNode, AppendableTextNode> CONCAT; @Name(verb = "sum", noun = "sum")
	static final Aggregation<INumericNode, INumericNode> SUM; @Name(verb = "count", noun = "count")
	static final Aggregation<IJsonNode, IntNode> COUNT; @Name(noun = "first")
	static final Aggregation<IJsonNode, IJsonNode> FIRST; @Name(verb = "sort")
	static final Aggregation<IJsonNode, ArrayNode> SORT; @Name(adjective = "all")
	static final Aggregation<IJsonNode, ArrayNode> ALL; @Name(noun = "average")
	static final Aggregation<INumericNode, ArrayNode> AVERAGE; static final EvaluationExpression PI; @Name(noun = "min")
	static final Aggregation<IJsonNode, IJsonNode> MIN; @Name(noun = "max")
	static final Aggregation<IJsonNode, IJsonNode> MAX; }
@Test public void shouldReturnCorrectSubstring() { TextNode result = new TextNode(); CoreFunctions.substring(result, TextNode.valueOf("0123456789"), IntNode.valueOf(3), IntNode.valueOf(6)); Assert.assertEquals(TextNode.valueOf("345"), result); }