public static StackTraceElement[] filterStackTrace(StackTraceElement[] trace,
			String... patterns) {

		List<StackTraceElement> list = new ArrayList<>();
		for (StackTraceElement element : trace) {
			if (matchesAnyPattern(element, patterns)) {
				continue;
			}

			list.add(element);
		}
		return list.toArray(new StackTraceElement[list.size()]);

	}
Uses the given <code>patterns</code> to remove elements from the given stack trace.
The current implementation will simply perform a <code>toString()</code> on each element and
then check to see if that string contains any of the <code>patterns</code>.

@param trace the trace to filter
@param patterns the non-regex patterns used to perform a
				   {@link String#contains(CharSequence)} on each {@link StackTraceElement}
				   line.
@return the filtered trace
Ghidra/Framework/Utility/src/main/java/utilities/util/reflection/ReflectionUtilities.java