@Test
public void testCreateNode() throws NoSuchClassException {

    // GIVEN
    final String nodeId = "a";
    final List<String> nodeLabels = Arrays.asList("A");
    final Map<String, Object> nodeAttributes = ImmutableMap.<String, Object>builder().put("id", 1l).put("value", "foo").build();
    // WHEN
    final Node node = factory.createNode(nodeId, nodeLabels, nodeAttributes);
    // THEN
    assertThat(node, notNullValue());
    assertThat(node.getId(), equalTo(nodeId));
    assertThat(node.getLabels(), equalTo(nodeLabels));
    assertThat(node.getAttributes().size(), equalTo(2));
    final Attribute idAttribute = node.getAttributes().get(0);
    assertThat(idAttribute.getName(), equalTo("id"));
    assertThat(idAttribute.getValue(), equalTo(1l));
    assertThat(idAttribute.isId(), equalTo(Boolean.TRUE));
    final Attribute valueAttribute = node.getAttributes().get(1);
    assertThat(valueAttribute.getName(), equalTo("value"));
    assertThat(valueAttribute.getValue(), equalTo("foo"));
    assertThat(valueAttribute.isId(), equalTo(Boolean.FALSE));
}