private Set<Class<?>> getParentTypes(String name, Class<?> type) {
String[] path = name.split("\\.");
try {
for (int i = 0; i < path.length - 1; i++) {
Field field = checkNotNull(new Mirror().on(type).reflect().field(path[i]));
type = getActualType(field.getGenericType());
}
checkNotNull(new Mirror().on(type).reflect().field(path[path.length -1]));
} catch (NullPointerException e) {
throw new IllegalArgumentException("Field path '" + name + "' doesn't exists in " + type, e);
}
Set<Class<?>> types = Sets.newHashSet();