private static class TestPostProvider implements PostProvider {
+ @Nullable
@Override
- public Optional<Post> getPost(final String postId) {
- return Optional.<Post>of(new Post() {
+ public Post getPost(@Nonnull final String postId) {
+ return new Post() {
@Override
public String getId() {
return postId;
public Post setKnown(boolean known) {
return null;
}
- });
+ };
}
@Override
private static class AbsentPostProvider extends TestPostProvider {
+ @Nullable
@Override
- public Optional<Post> getPost(String postId) {
- return Optional.absent();
+ public Post getPost(@Nonnull String postId) {
+ return null;
}
}