@Test public void nodeFromComponent() { Node node = Node.of(Component.of("apocalypse", "villain")); Assert.assertEquals("villain:apocalypse", node.getId()); Assert.assertEquals("villain:apocalypse", node.getLabel()); Assert.assertTrue(node.getSize() > 2); Assert.assertTrue(node.getX() >= 0); Assert.assertTrue(node.getY() >= 0); }
public static Node of(Component component) { return Node.of(component, randomSize()); }
Node { public static Node of(Component component) { return Node.of(component, randomSize()); } }
Node { public static Node of(Component component) { return Node.of(component, randomSize()); }  }
Node { public static Node of(Component component) { return Node.of(component, randomSize()); }  static Node create(String id, String label); static Node of(Component component); static Node of(Component component, int size); static Node of(ComponentRelationships rel); @Override boolean equals(Object o); @Override int hashCode(); static int randomSize(); static int randomCoordinate(); }
Node { public static Node of(Component component) { return Node.of(component, randomSize()); }  static Node create(String id, String label); static Node of(Component component); static Node of(Component component, int size); static Node of(ComponentRelationships rel); @Override boolean equals(Object o); @Override int hashCode(); static int randomSize(); static int randomCoordinate();  }