### Question:
AssociationConnectorDef implements BPMNShapeDef<Association, ShapeView>,
                   ConnectorShapeDef<Association, ShapeView> { @Override public Direction getDirection(Association definition) { return Optional.ofNullable(definition) .filter(def -> def instanceof NonDirectionalAssociation) .map(def -> Direction.NONE) .orElse(Direction.ONE); }  @Override FontHandler<Association, ShapeView> newFontHandler(); @Override Glyph getGlyph(final Class type,
                          final String defId); @Override DashArray getDashArray(final Association element); @Override Direction getDirection(Association definition);  }### Answer:
@Test public void getDirection() { ConnectorShapeDef.Direction direction = tested.getDirection(new DirectionalAssociation()); assertEquals(ConnectorShapeDef.Direction.ONE, direction); direction = tested.getDirection(new NonDirectionalAssociation()); assertEquals(ConnectorShapeDef.Direction.NONE, direction); direction = tested.getDirection(mock(Association.class)); assertEquals(ConnectorShapeDef.Direction.ONE, direction); }