@Test public void testToString() throws CandidateAlreadyRegisteredException { final UUID uuid = UUID.randomUUID(); final String expected = String.format("SimpleDOMEntityOwnershipService{uuid=%s, entities={}, listeners={}}", uuid); assertEquals(expected, new SimpleDOMEntityOwnershipService(uuid).toString()); }
@Override public String toString() { final ToStringHelper h = MoreObjects.toStringHelper(SimpleDOMEntityOwnershipService.class).add("uuid", uuid); synchronized (entities) { h.add("entities", entities); } synchronized (listeners) { h.add("listeners", listeners); } return h.toString(); }
SimpleDOMEntityOwnershipService implements DOMEntityOwnershipService { @Override public String toString() { final ToStringHelper h = MoreObjects.toStringHelper(SimpleDOMEntityOwnershipService.class).add("uuid", uuid); synchronized (entities) { h.add("entities", entities); } synchronized (listeners) { h.add("listeners", listeners); } return h.toString(); } }
SimpleDOMEntityOwnershipService implements DOMEntityOwnershipService { @Override public String toString() { final ToStringHelper h = MoreObjects.toStringHelper(SimpleDOMEntityOwnershipService.class).add("uuid", uuid); synchronized (entities) { h.add("entities", entities); } synchronized (listeners) { h.add("listeners", listeners); } return h.toString(); } @VisibleForTesting  SimpleDOMEntityOwnershipService(final UUID uuid);  SimpleDOMEntityOwnershipService(); }
SimpleDOMEntityOwnershipService implements DOMEntityOwnershipService { @Override public String toString() { final ToStringHelper h = MoreObjects.toStringHelper(SimpleDOMEntityOwnershipService.class).add("uuid", uuid); synchronized (entities) { h.add("entities", entities); } synchronized (listeners) { h.add("listeners", listeners); } return h.toString(); } @VisibleForTesting  SimpleDOMEntityOwnershipService(final UUID uuid);  SimpleDOMEntityOwnershipService(); @Override DOMEntityOwnershipCandidateRegistration registerCandidate(final DOMEntity entity); @Override DOMEntityOwnershipListenerRegistration registerListener(final String entityType,
            final DOMEntityOwnershipListener listener); @Override Optional<EntityOwnershipState> getOwnershipState(final DOMEntity forEntity); @Override boolean isCandidateRegistered(final DOMEntity forEntity); @Override String toString(); }
SimpleDOMEntityOwnershipService implements DOMEntityOwnershipService { @Override public String toString() { final ToStringHelper h = MoreObjects.toStringHelper(SimpleDOMEntityOwnershipService.class).add("uuid", uuid); synchronized (entities) { h.add("entities", entities); } synchronized (listeners) { h.add("listeners", listeners); } return h.toString(); } @VisibleForTesting  SimpleDOMEntityOwnershipService(final UUID uuid);  SimpleDOMEntityOwnershipService(); @Override DOMEntityOwnershipCandidateRegistration registerCandidate(final DOMEntity entity); @Override DOMEntityOwnershipListenerRegistration registerListener(final String entityType,
            final DOMEntityOwnershipListener listener); @Override Optional<EntityOwnershipState> getOwnershipState(final DOMEntity forEntity); @Override boolean isCandidateRegistered(final DOMEntity forEntity); @Override String toString();  }