### Question:
DMNClientProjectDiagramService extends ClientProjectDiagramService { ProjectDiagramImpl asProjectDiagramImpl(final Diagram diagram, final DMNContentResource resource) { final String name = removeExtension(diagram.getName()); final Graph graph = diagram.getGraph(); final ProjectMetadata metadata = (ProjectMetadata) resource.getMetadata(); return new ProjectDiagramImpl(name, graph, metadata); } @Inject  DMNClientProjectDiagramService(final ShapeManager shapeManager,
                                          final SessionManager sessionManager,
                                          final Caller<ProjectDiagramService> diagramServiceCaller,
                                          final Caller<DiagramLookupService> diagramLookupServiceCaller,
                                          final Event<SessionDiagramSavedEvent> saveEvent,
                                          final Caller<DMNContentService> dmnContentServiceCaller,
                                          final DMNMarshallerService dmnMarshallerService); @Override void getByPath(final Path path,
                          final ServiceCallback<ProjectDiagram> callback); @Override void saveOrUpdate(final Path path,
                             final ProjectDiagram diagram,
                             final Metadata metadata,
                             final String comment,
                             final ServiceCallback<ProjectDiagram> callback);  }### Answer:
@Test public void testAsProjectDiagramImpl() { final Graph graph = mock(Graph.class); final Diagram diagram = mock(Diagram.class); final DMNContentResource resource = mock(DMNContentResource.class); final ProjectMetadata metadata = mock(ProjectMetadata.class); when(diagram.getName()).thenReturn("Traffic Violation.dmn"); when(diagram.getGraph()).thenReturn(graph); when(resource.getMetadata()).thenReturn(metadata); final ProjectDiagramImpl projectDiagram = service.asProjectDiagramImpl(diagram, resource); assertEquals("Traffic Violation", projectDiagram.getName()); assertEquals(graph, projectDiagram.getGraph()); assertEquals(metadata, projectDiagram.getMetadata()); }