@Test public void testGetNodes() { final Graph graph = mock(Graph.class); final Node node1 = mock(Node.class); final Node node2 = mock(Node.class); final Iterable<Node> expectedNodes = asList(node1, node2); when(graph.nodes()).thenReturn(expectedNodes); doReturn(Optional.of(graph)).when(notifier).getGraph(); final List<Node> actualNodes = notifier.getNodes(); assertEquals(expectedNodes, actualNodes); }
List<Node> getNodes() { final List<Node> nodes = new ArrayList<>(); getGraph().ifPresent(graph -> { graph.nodes().forEach(nodes::add); }); return nodes; }
PropertiesPanelNotifier { List<Node> getNodes() { final List<Node> nodes = new ArrayList<>(); getGraph().ifPresent(graph -> { graph.nodes().forEach(nodes::add); }); return nodes; } }
PropertiesPanelNotifier { List<Node> getNodes() { final List<Node> nodes = new ArrayList<>(); getGraph().ifPresent(graph -> { graph.nodes().forEach(nodes::add); }); return nodes; } @Inject  PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                                   final SessionManager sessionManager); }
PropertiesPanelNotifier { List<Node> getNodes() { final List<Node> nodes = new ArrayList<>(); getGraph().ifPresent(graph -> { graph.nodes().forEach(nodes::add); }); return nodes; } @Inject  PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                                   final SessionManager sessionManager); PropertiesPanelNotifier withOldLocalPart(final String oldLocalPart); PropertiesPanelNotifier withNewQName(final QName newQName); void notifyPanel(); }
PropertiesPanelNotifier { List<Node> getNodes() { final List<Node> nodes = new ArrayList<>(); getGraph().ifPresent(graph -> { graph.nodes().forEach(nodes::add); }); return nodes; } @Inject  PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                                   final SessionManager sessionManager); PropertiesPanelNotifier withOldLocalPart(final String oldLocalPart); PropertiesPanelNotifier withNewQName(final QName newQName); void notifyPanel();  }