debug("ENTRY", category, key, null, null);
if (!category.isAssignableFrom(valueClass)) {
if (debug) {
debug("THROW", category, key, "unexpected type:", valueClass);
if (hint != null) {
if (debug) {
debug("CHECK", category, key, "user provided a", hint.getClass());
debug("RETURN", category, key, "return hint as provided.", null);
final Class<?> type = types[i];
if (debug) {
debug("CHECK", category, key, "consider hint[" + i + ']', type);
debug("RETURN", category, key, "found implementation", candidate.getClass());
debug("CHECK", category, key, "consider hint[last]", implementation);
debug("RETURN", category, key, "found implementation", candidate.getClass());
debug("THROW", category, key, "could not find implementation.", null);