ResourceAccess { public ResourceAccess setGranted(boolean granted) { this.granted = granted; return this; }  ResourceAccess setGranted(boolean granted); boolean getGranted(); @Override boolean equals(Object another); public boolean granted; }
@Test public void testSetGranted() { ResourceAccess a = new ResourceAccess(); assertTrue(a.setGranted(true).granted); }
@Test public void testEqualsSameObj() { ResourceAccess a = new ResourceAccess().setGranted(true); ResourceAccess b = new ResourceAccess().setGranted(false); assertEquals(a, a); assertNotEquals(a, b); b.setGranted(true); assertEquals(a, b); }