public static Position of(int index, int lastIndex) {
			if (index < 0) {
				throw new IllegalArgumentException("index can't be negative");
			}
			else if (index == 0) {
				return start;
			}
			else if (index < lastIndex) {
				return middle;
			}
			else if (index == lastIndex) {
				return end;
			}
			else {
				throw new IllegalArgumentException("index can't be greater than lastIndex");
			}
		}
Return the position instance for a module appearing at {@code index} inside a stream made of [0..lastIndex]
(inclusive).
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/stream/ParsingContext.java