@Nullable
  private Task getTask(int id, XmlRpcClient client, Transport transport) throws IOException, XmlRpcException {
    XmlRpcRequest request = new XmlRpcRequest("ticket.get", new Vector(Collections.singletonList(id)));
    Object response = client.execute(request, transport);
    if (response == null) return null;
    final Vector<Object> vector = (Vector<Object>)response;
    final Hashtable<String, String> map = (Hashtable<String, String>)vector.get(3);
    return new Task() {

      @NotNull
      @Override
      public String getId() {
        return vector.get(0).toString();
      }

      @NotNull
      @Override
      public String getSummary() {
        //noinspection HardCodedStringLiteral
        return map.get("summary");
      }

      @Nullable
      @Override
      public String getDescription() {
        return null;
      }

      @Override
      public Comment @NotNull [] getComments() {
        return Comment.EMPTY_ARRAY;
      }

      @NotNull
      @Override
      public Icon getIcon() {
        return TasksCoreIcons.Trac;
      }

      @NotNull
      @Override
      public TaskType getType() {
        String type = map.get("type");
        if (type == null) return TaskType.OTHER;
        return switch (type) {
          case "Feature", "enhancement" -> TaskType.FEATURE;
          case "Bug", "defect", "error" -> TaskType.BUG;
          case "Exception" -> TaskType.EXCEPTION;
          default -> TaskType.OTHER;
        };
      }

      @Override
      public @NotNull Date getUpdated() {
        return getDate(vector.get(2));
      }

      @Override
      public @NotNull Date getCreated() {
        return getDate(vector.get(1));
      }

      @Override
      public boolean isClosed() {
        return false;
      }

      @Override
      public boolean isIssue() {
        return true;
      }

      @Nullable
      @Override
      public String getIssueUrl() {
        return null;
      }

      @Override
      public @NotNull TaskRepository getRepository() {
        return TracRepository.this;
      }
    };
  }
@Nullable
  private Task getTask(int id, XmlRpcClient client, Transport transport)