public void replace(T item) throws IOException {
        for (T t : data) {
            if (t.getClass() == item.getClass()) {
                data.remove(t);
            }
        }
        data.add(item);
        onModified();
    }
@Test
    public void replace() throws Exception {
        AtomicInteger count = new AtomicInteger();
        DescribableList<Datum, Descriptor<Datum>> list = new DescribableList<>((Saveable) count::incrementAndGet);
        list.add(new Datum(1));
        list.add(new Datum(2));
        assertThat(count.get(), is(2));
        list.replace(new Datum(3));
        assertThat(list.stream().map(d -> d.val).toArray(Integer[]::new), arrayContaining(3));
        assertThat(count.get(), is(3));
    }