@Override
    public boolean isSubTypeOf(Class<?> ancestor) {
        checkNotNull(ancestor);

        return id.isSubTypeOf(ancestor);
    }
@Test
    public void testSubTypeOf() {
        ContinuousResource continuous = Resources.continuous(D1, P1, Bandwidth.class)
                .resource(BW1.bps());

        assertThat(continuous.isSubTypeOf(DeviceId.class), is(true));
        assertThat(continuous.isSubTypeOf(PortNumber.class), is(true));
        assertThat(continuous.isSubTypeOf(Bandwidth.class), is(true));
        assertThat(continuous.isSubTypeOf(VlanId.class), is(false));
    }