### Question:
BusinessDataReferenceResourceFinder extends ResourceFinder { @Override public Serializable toClientObject(Serializable object) { return BusinessDataReferenceResource.toClient((BusinessDataReference) object); }  @Override ServerResource create(final Request request, final Response response); @Override boolean handlesResource(Serializable object); @Override Serializable toClientObject(Serializable object);  }### Answer:
@Test public void should_return_a_context_of_type_MultipleBusinessDataRef_for_a_given_task_instance() throws Exception { MultipleBusinessDataReferenceImpl bizDataRef = new MultipleBusinessDataReferenceImpl("Ticket", "com.acme.object.Ticket", Arrays.asList(7L, 8L)); Serializable contextResultElement = businessDataReferenceResourceFinder.toClientObject(bizDataRef); assertThat(contextResultElement).isInstanceOf(MultipleBusinessDataReferenceClient.class); final MultipleBusinessDataReferenceClient businessDataReferenceClient = (MultipleBusinessDataReferenceClient) contextResultElement; assertThat(businessDataReferenceClient.getName()).isEqualTo("Ticket"); assertThat(businessDataReferenceClient.getType()).isEqualTo("com.acme.object.Ticket"); assertThat(businessDataReferenceClient.getStorageIds()).containsExactly(7L, 8L); assertThat(businessDataReferenceClient.getStorageIdsAsString()).containsExactly("7", "8"); assertThat(businessDataReferenceClient.getLink()).isEqualTo("API/bdm/businessData/com.acme.object.Ticket/findByIds?ids=7,8"); }
@Test public void should_return_a_context_of_type_Simple_for_a_given_task_instance() throws Exception { SimpleBusinessDataReferenceImpl bizDataRef = new SimpleBusinessDataReferenceImpl("Ticket", "com.acme.object.Ticket", 8L); Serializable contextResultElement = businessDataReferenceResourceFinder.toClientObject(bizDataRef); assertThat(contextResultElement).isInstanceOf(SimpleBusinessDataReferenceClient.class); final SimpleBusinessDataReferenceClient businessDataReferenceClient = (SimpleBusinessDataReferenceClient) contextResultElement; assertThat(businessDataReferenceClient.getName()).isEqualTo("Ticket"); assertThat(businessDataReferenceClient.getType()).isEqualTo("com.acme.object.Ticket"); assertThat(businessDataReferenceClient.getStorageId()).isEqualTo(8L); assertThat(businessDataReferenceClient.getStorageIdAsString()).isEqualTo("8"); assertThat(businessDataReferenceClient.getLink()).isEqualTo("API/bdm/businessData/com.acme.object.Ticket/8"); }