class Serializers {

	public static void recursivelyRegisterType(TypeInformation<?> typeInfo, ExecutionConfig config, Set<Class<?>> alreadySeen) {
		if (typeInfo instanceof GenericTypeInfo) {
			GenericTypeInfo<?> genericTypeInfo = (GenericTypeInfo<?>) typeInfo;
			Serializers.recursivelyRegisterType(genericTypeInfo.getTypeClass(), config, alreadySeen);
		}
		else if (typeInfo instanceof CompositeType) {
			List<GenericTypeInfo<?>> genericTypesInComposite = new ArrayList<>();
			getContainedGenericTypes((CompositeType<?>)typeInfo, genericTypesInComposite);
			for (GenericTypeInfo<?> gt : genericTypesInComposite) {
				Serializers.recursivelyRegisterType(gt.getTypeClass(), config, alreadySeen);
			}
		}
		else if (typeInfo instanceof ObjectArrayTypeInfo) {
			ObjectArrayTypeInfo<?, ?> objectArrayTypeInfo = (ObjectArrayTypeInfo<?, ?>) typeInfo;
			recursivelyRegisterType(objectArrayTypeInfo.getComponentInfo(), config, alreadySeen);
		}
	}

}