private int computeBestOffset(int invocationOffset, Position pos, int initalOffset) { int newOffset= pos.offset; if (newOffset <= initalOffset && initalOffset <= newOffset + pos.length) return initalOffset;
private static int computeBestOffset(int newOffset, int invocationLocation, int bestOffset) { if (newOffset <= invocationLocation) { if (bestOffset > invocationLocation) { return newOffset; } else if (bestOffset <= newOffset) { return newOffset; } return -1; }
	private int computeBestOffset(int invocationOffset, Position pos, int initalOffset) {		int newOffset= pos.offset;		if (newOffset <= initalOffset && initalOffset <= newOffset + pos.length)			return initalOffset;		if (invocationOffset < 0)			return newOffset;		if (newOffset <= initalOffset && invocationOffset >= initalOffset)			return newOffset;		if (newOffset <= initalOffset && invocationOffset < initalOffset)			return Math.max(invocationOffset, newOffset);		if (invocationOffset <= initalOffset)			return invocationOffset;		return Math.max(invocationOffset, newOffset);	}