diff --git a/pom.xml b/pom.xml
index bd812b8..4bc3206 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,6 +31,7 @@
     <basic-annotations.version>0.2.0</basic-annotations.version>
     <findbugs-jsr305.version>3.0.2</findbugs-jsr305.version>
     <flexmark.version>0.61.10</flexmark.version>
+    <google.java.format.version>1.7</google.java.format.version>
     <hibernate.version>5.4.14.Final</hibernate.version>
     <hibernate-types.version>2.9.8</hibernate-types.version>
     <jakarta-jacc-api.version>1.6.1</jakarta-jacc-api.version>
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/PageKeyPK.java b/src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/PageKeyPK.java
index e80cb5e..f79686f 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/PageKeyPK.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/PageKeyPK.java
@@ -2,6 +2,7 @@
 
 import java.io.Serializable;
 import java.math.BigInteger;
+import java.util.Objects;
 import javax.persistence.Column;
 import javax.persistence.Id;
 
@@ -41,14 +42,10 @@
 
     PageKeyPK pageKeyPK = (PageKeyPK) o;
 
-    if (page != null ? !page.equals(pageKeyPK.page) : pageKeyPK.page != null) {
+    if (!Objects.equals(page, pageKeyPK.page)) {
       return false;
     }
-    if (key != null ? !key.equals(pageKeyPK.key) : pageKeyPK.key != null) {
-      return false;
-    }
-
-    return true;
+    return Objects.equals(key, pageKeyPK.key);
   }
 
   @Override
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java
index 5ff8463..6dc76b0 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java
@@ -1,7 +1,10 @@
 package eu.mulk.mulkcms2.benki.bookmarks;
 
+import static javax.ws.rs.core.MediaType.APPLICATION_FORM_URLENCODED;
 import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
+import static javax.ws.rs.core.MediaType.MULTIPART_FORM_DATA;
 import static javax.ws.rs.core.MediaType.TEXT_HTML;
+import static javax.ws.rs.core.MediaType.WILDCARD;
 
 import eu.mulk.mulkcms2.benki.posts.Post;
 import eu.mulk.mulkcms2.benki.posts.PostFilter;
@@ -22,6 +25,7 @@
 import javax.transaction.Transactional;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
 import javax.ws.rs.FormParam;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
@@ -45,6 +49,8 @@
   @POST
   @Transactional
   @Authenticated
+  @Produces(WILDCARD)
+  @Consumes({APPLICATION_FORM_URLENCODED, MULTIPART_FORM_DATA})
   public Response postBookmark(
       @FormParam("uri") @NotNull URI uri,
       @FormParam("title") @NotEmpty String title,
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReferencePK.java b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReferencePK.java
index 28ee2e0..20ff71c 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReferencePK.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReferencePK.java
@@ -43,11 +43,7 @@
     if (referrerId != that.referrerId) {
       return false;
     }
-    if (refereeId != that.refereeId) {
-      return false;
-    }
-
-    return true;
+    return refereeId == that.refereeId;
   }
 
   @Override
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java
index b919ad3..4f9a9fb 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java
@@ -1,5 +1,9 @@
 package eu.mulk.mulkcms2.benki.lazychat;
 
+import static javax.ws.rs.core.MediaType.APPLICATION_FORM_URLENCODED;
+import static javax.ws.rs.core.MediaType.MULTIPART_FORM_DATA;
+import static javax.ws.rs.core.MediaType.WILDCARD;
+
 import eu.mulk.mulkcms2.benki.posts.Post;
 import eu.mulk.mulkcms2.benki.posts.PostFilter;
 import eu.mulk.mulkcms2.benki.posts.PostResource;
@@ -10,12 +14,14 @@
 import java.util.Objects;
 import javax.transaction.Transactional;
 import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
 import javax.ws.rs.ForbiddenException;
 import javax.ws.rs.FormParam;
 import javax.ws.rs.NotFoundException;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;
 
 @Path("/lazychat")
@@ -28,6 +34,8 @@
   @POST
   @Transactional
   @Authenticated
+  @Produces(WILDCARD)
+  @Consumes({APPLICATION_FORM_URLENCODED, MULTIPART_FORM_DATA})
   public Response postMessage(
       @FormParam("text") @NotNull String text,
       @FormParam("visibility") @NotNull Post.Visibility visibility)
@@ -51,6 +59,8 @@
   @POST
   @Transactional
   @Authenticated
+  @Produces(WILDCARD)
+  @Consumes({APPLICATION_FORM_URLENCODED, MULTIPART_FORM_DATA})
   @Path("{id}/edit")
   public Response patchMessage(
       @PathParam("id") int id,
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java
index c402265..fc0f76f 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java
@@ -42,7 +42,7 @@
 @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
 public abstract class Post extends PanacheEntityBase {
 
-  private static Logger log = Logger.getLogger(Post.class);
+  private static final Logger log = Logger.getLogger(Post.class);
 
   @Id
   @SequenceGenerator(
@@ -171,10 +171,10 @@
   }
 
   public static class PostPage<T extends Post> {
-    public @CheckForNull Integer prevCursor;
-    public @CheckForNull Integer cursor;
-    public @CheckForNull Integer nextCursor;
-    public List<T> posts;
+    public @CheckForNull final Integer prevCursor;
+    public @CheckForNull final Integer cursor;
+    public @CheckForNull final Integer nextCursor;
+    public final List<T> posts;
 
     private PostPage(
         @CheckForNull Integer c0,
@@ -259,7 +259,7 @@
       }
     }
 
-    return new PostPage<T>(prevCursor, cursor, nextCursor, forwardResults);
+    return new PostPage<>(prevCursor, cursor, nextCursor, forwardResults);
   }
 
   public enum Visibility {
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java
index 59bfb89..c718bbc 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java
@@ -28,6 +28,7 @@
 import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
@@ -169,6 +170,7 @@
         Date.from(
             posts.stream()
                 .map(x -> x.date)
+                .filter(Objects::nonNull)
                 .max(Comparator.comparing(x -> x))
                 .orElse(OffsetDateTime.ofInstant(Instant.EPOCH, ZoneOffset.UTC))
                 .toInstant()));
@@ -192,8 +194,10 @@
                   var entry = new Entry();
 
                   entry.setId(String.format("tag:%s,2012:/marx/%d", tagBase, post.id));
-                  entry.setPublished(Date.from(post.date.toInstant()));
-                  entry.setUpdated(Date.from(post.date.toInstant()));
+                  if (post.date != null) {
+                    entry.setPublished(Date.from(post.date.toInstant()));
+                    entry.setUpdated(Date.from(post.date.toInstant()));
+                  }
 
                   var author = new SyndPersonImpl();
                   author.setName(post.owner.getFirstAndLastName());
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostTargetPK.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostTargetPK.java
index ecd5861..e439ec9 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostTargetPK.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostTargetPK.java
@@ -43,11 +43,7 @@
     if (message != that.message) {
       return false;
     }
-    if (targetId != that.targetId) {
-      return false;
-    }
-
-    return true;
+    return targetId == that.targetId;
   }
 
   @Override
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/users/RsaKeyPK.java b/src/main/java/eu/mulk/mulkcms2/benki/users/RsaKeyPK.java
index 5b33ec8..83f4ced 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/users/RsaKeyPK.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/users/RsaKeyPK.java
@@ -2,6 +2,7 @@
 
 import java.io.Serializable;
 import java.math.BigInteger;
+import java.util.Objects;
 import javax.persistence.Column;
 import javax.persistence.Id;
 
@@ -41,14 +42,10 @@
 
     RsaKeyPK rsaKeyPK = (RsaKeyPK) o;
 
-    if (modulus != null ? !modulus.equals(rsaKeyPK.modulus) : rsaKeyPK.modulus != null) {
+    if (!Objects.equals(modulus, rsaKeyPK.modulus)) {
       return false;
     }
-    if (exponent != null ? !exponent.equals(rsaKeyPK.exponent) : rsaKeyPK.exponent != null) {
-      return false;
-    }
-
-    return true;
+    return Objects.equals(exponent, rsaKeyPK.exponent);
   }
 
   @Override
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/users/UserRolePK.java b/src/main/java/eu/mulk/mulkcms2/benki/users/UserRolePK.java
index 5649ff4..aca126d 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/users/UserRolePK.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/users/UserRolePK.java
@@ -43,11 +43,7 @@
     if (userId != that.userId) {
       return false;
     }
-    if (roleId != that.roleId) {
-      return false;
-    }
-
-    return true;
+    return roleId == that.roleId;
   }
 
   @Override
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/users/UserRsaKeyPK.java b/src/main/java/eu/mulk/mulkcms2/benki/users/UserRsaKeyPK.java
index adcaeb6..ef48c9a 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/users/UserRsaKeyPK.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/users/UserRsaKeyPK.java
@@ -2,6 +2,7 @@
 
 import java.io.Serializable;
 import java.math.BigInteger;
+import java.util.Objects;
 import javax.persistence.Column;
 import javax.persistence.Id;
 
@@ -55,14 +56,10 @@
     if (userId != that.userId) {
       return false;
     }
-    if (modulus != null ? !modulus.equals(that.modulus) : that.modulus != null) {
+    if (!Objects.equals(modulus, that.modulus)) {
       return false;
     }
-    if (exponent != null ? !exponent.equals(that.exponent) : that.exponent != null) {
-      return false;
-    }
-
-    return true;
+    return Objects.equals(exponent, that.exponent);
   }
 
   @Override
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiPageRevision.java b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiPageRevision.java
index df90421..161f371 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiPageRevision.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiPageRevision.java
@@ -95,10 +95,10 @@
     return soup;
   }
 
-  private static Pattern WIKIWORD_REGEX =
+  private static final Pattern WIKIWORD_REGEX =
       Pattern.compile(
           "\\p{javaUpperCase}+\\p{javaLowerCase}+\\p{javaUpperCase}+\\p{javaLowerCase}+\\w+");
-  private static Pattern URL_REGEX =
+  private static final Pattern URL_REGEX =
       Pattern.compile("\\(?\\bhttps?://[-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|]");
 
   private static Document hrefify(Document soup) {
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
index 5ed5dff..2ffcdd5 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
@@ -39,14 +39,14 @@
 @Path("/wiki")
 public class WikiResource {
 
-  private static Logger log = Logger.getLogger(WikiResource.class);
+  private static final Logger log = Logger.getLogger(WikiResource.class);
 
-  private static DateTimeFormatter htmlDateFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
+  private static final DateTimeFormatter htmlDateFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
 
-  private static DateTimeFormatter humanDateFormatter =
+  private static final DateTimeFormatter humanDateFormatter =
       DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG, FormatStyle.SHORT);
 
-  private static JsonProvider jsonProvider = JsonProvider.provider();
+  private static final JsonProvider jsonProvider = JsonProvider.provider();
 
   @ResourcePath("benki/wiki/wikiPage.html")
   @Inject
