public T merge(T other) {
        checkNotNull(other, "Cannot merge with null resources");
        checkArgument(getClass() == other.getClass(), "Merge with different resource type");
        checkArgument(name.equals(other.getName()), "Merge with different resource name");

        return create(value.add(other.getValue()));
    }
@Test
    void testMerge() {
        final Resource v1 = new TestResource(0.1);
        final Resource v2 = new TestResource(0.2);
        assertTestResourceValueEquals(0.3, v1.merge(v2));
    }