class BatchListenerFactoryHelper {

	public static <T> List<T> getListeners(StepListener[] listeners, Class<? super T> cls) {<FILL_FUNCTION_BODY>}

}

		List<T> list = new ArrayList<>();
		for (StepListener stepListener : listeners) {
			if (cls.isAssignableFrom(stepListener.getClass())) {
				@SuppressWarnings("unchecked")
				T listener = (T) stepListener;
				list.add(listener);
			}
		}
		return list;
	
<no_super_class>