code: private static void setViewFields(final Object object, final ViewFinder viewFinder) {
          Field[] fields = object.getClass().getDeclaredFields();
  
          for (Field field : fields) {
              if (field.isAnnotationPresent(ViewId.class)) {
                  field.setAccessible(true);
                  ViewId viewIdAnnotation = field.getAnnotation(ViewId.class);
                  try {
                      field.set(object, field.getType().cast(viewFinder.findViewById(viewIdAnnotation.value())));
                  } catch (IllegalAccessException e) {
                      e.printStackTrace();
                  }
              }
          }
      }
docs: Parse {@link ViewId} annotation and try to assign the view with that id to the annotated field.
  It will throw a {@link ClassCastException} if the field and the view with the given ID have different types.
  
  @param object     object where the annotation is.
  @param viewFinder callback that provides a way of finding the view by the viewID given in the annotation.