public static Object[] sliceFromLastBoundary(Object[] sequence, Boolean[] boundaries) {
		// Find the start and end of the word, which are the last and next
		// to last boundary indices. If there's only one boundary, the next
		// to last is effectively -1 (start of the text)
		int start = -1;
		int end = -1;
		for (int i = 0; i < boundaries.length; i++) {
			if (boundaries[i]) {
				start = end;
				end = i;
			}
		}

		// If there are no boundaries, throw an exception. This is to prevent
		// the caller (who is likely to call wordFromFinalBoundary later)
		// from getting the word twice
		if (start == end) throw new RuntimeException(
				"Cannot be called on a boundary array that contains no boundaries.");

		// Now get the appropriate slice from the text. Increase start and
		// end by one since they are aligned one left of the text
		return Arrays.copyOfRange(sequence, start + 1, end + 1, sequence.getClass());
	}