package com.example.helloworld.core;

import java.security.Principal;
import java.util.Random;
import java.util.Set;

public class User implements Principal {
    private final String name;

    private final Set<String> roles;

    public User(String name) {
        this.name = name;
        this.roles = null;
    }

    public User(String name, Set<String> roles) {
        this.name = name;
        this.roles = roles;
    }

    public String getName() {
        return name;
    }

    public int getId() {
        return new Random().nextInt(100);
    }

    public Set<String> getRoles() {
        return roles;
    }
}

@@ -152,16 +152,69 @@
 cipal %7B%0A
+    private static final Random rng = new Random();%0A%0A
     priv
@@ -575,28 +575,19 @@
  return 
-new Random()
+rng
 .nextInt

Use singleton `Random` in `User` in `dropwizard-example` (#4373)