DataContext (final DataContext original) { if (original.getData(DataConstants.PROJECT) == myProject) return original; return new DataContext() { public Object getData(String dataId) { if (DataConstants.PROJECT.equals(dataId)) { return myProject; } return original.getData(dataId); } }; }