BindingDOMEntityOwnershipServiceAdapter implements EntityOwnershipService, AutoCloseable { @Override public Optional<EntityOwnershipState> getOwnershipState(final Entity forEntity) { return domService.getOwnershipState(toDOMEntity(forEntity)); } @Inject  BindingDOMEntityOwnershipServiceAdapter(final @NonNull DOMEntityOwnershipService domService,
            final @NonNull AdapterContext adapterContext); @Override EntityOwnershipCandidateRegistration registerCandidate(final Entity entity); @Override EntityOwnershipListenerRegistration registerListener(final String entityType,
            final EntityOwnershipListener listener); @Override Optional<EntityOwnershipState> getOwnershipState(final Entity forEntity); @Override boolean isCandidateRegistered(final Entity forEntity); @Override void close();  }
@Test public void testGetOwnershipState() { final Optional<EntityOwnershipState> expectedState = Optional.of(EntityOwnershipState.IS_OWNER); doReturn(expectedState).when(this.mockDOMService).getOwnershipState(DOM_ENTITY); final Optional<EntityOwnershipState> actualState = this.adapter.getOwnershipState(BINDING_ENTITY); assertSame("getOwnershipState", expectedState, actualState); }