try {
Constructor<T> defaultConstructor = type.getDeclaredConstructor();
if (defaultConstructor == null)
throw new FacebookJsonMappingException("Unable to find a default constructor for " + type);
// Allows protected, private, and package-private constructors to be
// invoked
defaultConstructor.setAccessible(true);
return defaultConstructor.newInstance();
} catch (Exception e) {
throw new FacebookJsonMappingException(errorMessage, e);
}
}