OutOfResourceException extends Exception { public IResourceSource getSource() { return this.source; } OutOfResourceException(final IResourceSource source); IResourceSource getSource();  }
@Test public void Should_storeTheResourceSourceCausedTheException() throws Exception { IResourceSource source = mock(IResourceSource.class); OutOfResourceException exception = new OutOfResourceException(source); assertSame(source, exception.getSource()); }