FromEntityId extends KorypheFunction<EntityId, Object> { @Override public Object apply(final EntityId e) { if (null == e) { return null; } return e.getVertex(); }  @Override Object apply(final EntityId e);  }
@Test public void shouldReturnNullIfTheInputIsNull() { final EntityId input = null; final FromEntityId function = new FromEntityId(); final Object output = function.apply(input); assertNull(output); }
@Test public void shouldUnwrapIfInputIsAnEntitySeed() { final EntitySeed input = new EntitySeed("item"); final FromEntityId function = new FromEntityId(); final Object output = function.apply(input); assertSame(input.getVertex(), output); }
@Test public void shouldUnwrapIfInputIsAnEntity() { final Entity input = new Entity("group", "item"); final FromEntityId function = new FromEntityId(); final Object output = function.apply(input); assertSame(input.getVertex(), output); }