code: private boolean areClassesEqual(Class<?> c1, Class<?> c2) {
          if (isMap(c1)) {
              return isMap(c2);
          } else if (isList(c1)) {
              return isList(c2);
          } else {
              return c1.equals(c2);
          }
      }
docs: When comparing literals allow subclasses of Maps and Lists to be directly compared even if they have
  different implementations.