@Test public void testIsSame() throws Exception { Item delegate = mock(Item.class); Item otherItem = mock(Item.class); when(delegate.isSame(delegate)).thenReturn(true); when(delegate.isSame(otherItem)).thenReturn(false); ItemFacade<Item, Session> facade = getFacade(delegate); ItemFacade<Item, Session> self = getFacade(delegate); ItemFacade<Item, Session> otherFacade = getFacade(otherItem); assertTrue("same facade", facade.isSame(facade)); assertTrue("same as self", facade.isSame(self)); assertFalse("not same as other", facade.isSame(otherFacade)); }
@Override public final boolean isSame(Item otherItem) throws RepositoryException { return delegate.isSame(unwrap(otherItem)); }
ItemFacade implements Item { @Override public final boolean isSame(Item otherItem) throws RepositoryException { return delegate.isSame(unwrap(otherItem)); } }
ItemFacade implements Item { @Override public final boolean isSame(Item otherItem) throws RepositoryException { return delegate.isSame(unwrap(otherItem)); } @SuppressWarnings("WeakerAccess")  ItemFacade(final @NotNull J delegate, final @NotNull SessionFacade<S> session); }
ItemFacade implements Item { @Override public final boolean isSame(Item otherItem) throws RepositoryException { return delegate.isSame(unwrap(otherItem)); } @SuppressWarnings("WeakerAccess")  ItemFacade(final @NotNull J delegate, final @NotNull SessionFacade<S> session); @SuppressWarnings("WeakerAccess") static @NotNull Item ensureBestWrapper(final @NotNull Item primaryItem, final @NotNull SessionFacade<?> session); @Override final String getPath(); @Override final String getName(); @Override final Item getAncestor(int depth); @Override final Node getParent(); @Override final int getDepth(); @Override final Session getSession(); @Override final boolean isNode(); @Override final boolean isNew(); @Override final boolean isModified(); @Override final boolean isSame(Item otherItem); @Override final void accept(ItemVisitor visitor); @Override final void refresh(boolean keepChanges); @Override final void save(); @Override final void remove(); }
ItemFacade implements Item { @Override public final boolean isSame(Item otherItem) throws RepositoryException { return delegate.isSame(unwrap(otherItem)); } @SuppressWarnings("WeakerAccess")  ItemFacade(final @NotNull J delegate, final @NotNull SessionFacade<S> session); @SuppressWarnings("WeakerAccess") static @NotNull Item ensureBestWrapper(final @NotNull Item primaryItem, final @NotNull SessionFacade<?> session); @Override final String getPath(); @Override final String getName(); @Override final Item getAncestor(int depth); @Override final Node getParent(); @Override final int getDepth(); @Override final Session getSession(); @Override final boolean isNode(); @Override final boolean isNew(); @Override final boolean isModified(); @Override final boolean isSame(Item otherItem); @Override final void accept(ItemVisitor visitor); @Override final void refresh(boolean keepChanges); @Override final void save(); @Override final void remove();  }