### Question:
Resource extends LinkContainer<Resource<T>> implements ViewSupplier { public static <R> Resource<R> of(R data, URI self) { return new Resource<>(data, self); } @ConstructorProperties({"data", "_self"}) protected  Resource(T data, URI self); private  Resource(T data, URI self, Class<?> view); static Resource<R> of(R data, URI self); Resource<T> withView(Class<?> view);  }### Answer:
@Test public void resource_to_json() throws JsonProcessingException { Dummy info = new Dummy("1.0.0"); Resource<Dummy> resource = Resource.of(info, URI.create("http: assertResourceJson( mapper, object() .with("_self", "http: .with("version", "1.0.0") .with("connectors", "http: .end(), resource ); }
@Test(expected = NullPointerException.class) public void resource_not_null() { Resource.<String>of(null, URI.create("")); }
@Test public void container_first() { assertEquals(String.class, Resource.of("Test", URI.create("")).getViewType()); }