@Override
    public int compareTo(Resource other) {
        checkArgument(other != null && getClass() == other.getClass() && name.equals(other.name));
        return value.compareTo(other.value);
    }
@Test
    void testCompareToFailNull() {
        // new TestResource(0.0).compareTo(null);
        assertThatThrownBy(() -> new TestResource(0.0).compareTo(null))
                .isInstanceOf(IllegalArgumentException.class);
    }