class RegisterApplicationMasterResponseReflector {

	@VisibleForTesting
	Optional<Set<String>> getSchedulerResourceTypeNamesUnsafe(final Object response) {
		if (getSchedulerResourceTypesMethod.isPresent() && response != null) {
			try {
				@SuppressWarnings("unchecked")
				final Set<? extends Enum> schedulerResourceTypes = (Set<? extends Enum>) getSchedulerResourceTypesMethod.get().invoke(response);
				return Optional.of(
					Preconditions.checkNotNull(schedulerResourceTypes)
						.stream()
						.map(Enum::name)
						.collect(Collectors.toSet()));
			} catch (Exception e) {
				logger.error("Error invoking 'getSchedulerResourceTypes()'", e);
			}
		}

		return Optional.empty();
	}

	  RegisterApplicationMasterResponseReflector(final Logger log);
	@VisibleForTesting  RegisterApplicationMasterResponseReflector(final Logger log, final Class<?> clazz);

}