code: public <T, E extends T> void copyPropertiesOfInheritedClass(final T src, final E dest) {
          if (src == null) {
              throw new IllegalArgumentException("src can't be null");
          }
          if (dest == null) {
              throw new IllegalArgumentException("dest can't be null");
          }
          final Class<? extends Object> srcClz = src.getClass();
          final Class<? extends Object> destClz = dest.getClass();
          if (srcClz.isArray()) {
              if (!destClz.isArray()) {
                  throw new IllegalArgumentException("can't copy from array to non-array class " + destClz);
              }
              final int length = Array.getLength(src);
              for (int i = 0; i < length; i++) {
                  final Object v = Array.get(src, i);
                  Array.set(dest, i, v);
              }
              return;
          }
          final List<Field> fields = allFields(srcClz);
          for (final Field field : fields) {
              if (!Modifier.isStatic(field.getModifiers())) {
                  try {
                      final Object fieldObject = field.get(src);
                      field.set(dest, fieldObject);
                  } catch (final IllegalArgumentException e) {
                      throw new RuntimeException(e);
                  } catch (final IllegalAccessException e) {
                      throw new RuntimeException(e);
                  }
              }
          }
      }
docs: copies all properties from src to dest. Src and dest can be of different class, provided they contain same field names
  
  @param src
  the source object
  @param dest
  the destination object which must contain as minimul all the fields of src