PropertyDescriptor getPropDescriptor(final Class<?> clazz, final String prop)
        throws NoSuchFieldException {
    try {
      Optional<PropertyDescriptor> pd 
          = Stream.of(Introspector.getBeanInfo(clazz).getPropertyDescriptors())
               .filter(d -> d.getName().equals(prop))
               .findAny();
      if (pd.isPresent()) {
        PropertyDescriptor d = pd.get();
        // if there is no property setter, check if type 
        // is `Collection` (i. e. in JAXB)
        if (d.getWriteMethod() != null 
            || (Collection.class.isAssignableFrom(d.getPropertyType()))) {
          return d;
        }
      }
      throw new NoSuchFieldException(String.format("'%s' in %s", prop, clazz));
    } catch (IntrospectionException e) {
      throw new RuntimeException("Cannot introspect class " + clazz, e);
    }
  }