@Test @SuppressWarnings("unchecked") public void testBuild() { when(testingkHelper.getDefinitionAdapter().getId(eq(definition))).thenReturn(DefinitionId.build(DEF_ID)); final Node<Definition<Object>, Edge> node = tested.build(UUID, definition); assertNotNull(node); assertEquals(UUID, node.getUUID()); assertEquals(3, node.getLabels().size()); assertTrue(node.getLabels().contains(DEF_ID)); assertTrue(node.getLabels().contains("label1")); assertTrue(node.getLabels().contains("label2")); }
@Override @SuppressWarnings("unchecked") public Node<Definition<Object>, Edge> build(final String uuid, final Object definition) { final NodeImpl node = new NodeImpl<>(uuid); final Bounds bounds = definitionUtils.buildBounds(definition, 0d, 0d); View<Object> content = new ViewImpl<>(definition, bounds); node.setContent(content); appendLabels(node.getLabels(), definition); return node; }
NodeFactoryImpl extends AbstractElementFactory<Object, Definition<Object>, Node<Definition<Object>, Edge>> implements NodeFactory<Object> { @Override @SuppressWarnings("unchecked") public Node<Definition<Object>, Edge> build(final String uuid, final Object definition) { final NodeImpl node = new NodeImpl<>(uuid); final Bounds bounds = definitionUtils.buildBounds(definition, 0d, 0d); View<Object> content = new ViewImpl<>(definition, bounds); node.setContent(content); appendLabels(node.getLabels(), definition); return node; } }
NodeFactoryImpl extends AbstractElementFactory<Object, Definition<Object>, Node<Definition<Object>, Edge>> implements NodeFactory<Object> { @Override @SuppressWarnings("unchecked") public Node<Definition<Object>, Edge> build(final String uuid, final Object definition) { final NodeImpl node = new NodeImpl<>(uuid); final Bounds bounds = definitionUtils.buildBounds(definition, 0d, 0d); View<Object> content = new ViewImpl<>(definition, bounds); node.setContent(content); appendLabels(node.getLabels(), definition); return node; } protected  NodeFactoryImpl(); @Inject  NodeFactoryImpl(final DefinitionUtils definitionUtils); }
NodeFactoryImpl extends AbstractElementFactory<Object, Definition<Object>, Node<Definition<Object>, Edge>> implements NodeFactory<Object> { @Override @SuppressWarnings("unchecked") public Node<Definition<Object>, Edge> build(final String uuid, final Object definition) { final NodeImpl node = new NodeImpl<>(uuid); final Bounds bounds = definitionUtils.buildBounds(definition, 0d, 0d); View<Object> content = new ViewImpl<>(definition, bounds); node.setContent(content); appendLabels(node.getLabels(), definition); return node; } protected  NodeFactoryImpl(); @Inject  NodeFactoryImpl(final DefinitionUtils definitionUtils); @Override Class<? extends ElementFactory> getFactoryType(); @Override @SuppressWarnings("unchecked") Node<Definition<Object>, Edge> build(final String uuid,
                                                final Object definition); @Override boolean accepts(final Object source); }
NodeFactoryImpl extends AbstractElementFactory<Object, Definition<Object>, Node<Definition<Object>, Edge>> implements NodeFactory<Object> { @Override @SuppressWarnings("unchecked") public Node<Definition<Object>, Edge> build(final String uuid, final Object definition) { final NodeImpl node = new NodeImpl<>(uuid); final Bounds bounds = definitionUtils.buildBounds(definition, 0d, 0d); View<Object> content = new ViewImpl<>(definition, bounds); node.setContent(content); appendLabels(node.getLabels(), definition); return node; } protected  NodeFactoryImpl(); @Inject  NodeFactoryImpl(final DefinitionUtils definitionUtils); @Override Class<? extends ElementFactory> getFactoryType(); @Override @SuppressWarnings("unchecked") Node<Definition<Object>, Edge> build(final String uuid,
                                                final Object definition); @Override boolean accepts(final Object source);  }