code: public <T extends Cause> T findCause(Class<T> type) {
          for (Cause c : causeBag.keySet())
              if (type.isInstance(c))
                  return type.cast(c);
          return null;
      }
docs: Finds the cause of the specific type.