code: public void remove(Class<? extends T> type) throws IOException {
          for (T t : data) {
              if(t.getClass()==type) {
                  data.remove(t);
                  onModified();
                  return;
              }
          }
      }
docs: Removes an instance by its type.