@Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        } else if (o != null && getClass() == o.getClass()) {
            @SuppressWarnings("unchecked")
            T other = (T) o;

            // Two Resources are considered equal if the values equals disregarding the scales
            return name.equals(other.getName()) && value.compareTo(other.getValue()) == 0;
        } else {
            return false;
        }
    }
@Test
    void testEquals() {
        final Resource v1 = new TestResource(0.1);
        final Resource v2 = new TestResource(0.1);
        final Resource v3 = new TestResource(0.2);
        assertThat(v2).isEqualTo(v1);
        assertThat(v3).isNotEqualTo(v1);
    }