class ShouldHavePackage extends BasicErrorMessageFactory {
  private static final String SHOULD_HAVE_PACKAGE = new StringJoiner("%n", "%n", "").add("Expecting")
                                                                                    .add("  %s")
                                                                                    .add("to have package:")
                                                                                    .add("  %s")
                                                                                    .toString();
  private static final String BUT_HAD_NONE = new StringJoiner("%n", "%n", "").add("but had none.")
                                                                             .toString();
  private static final String BUT_HAD = new StringJoiner("%n", "%n", "").add("but had:")
                                                                        .add("  %s")
                                                                        .toString();

  /**
   * Creates a new <code>ShouldHavePackage</code> with a {@link Package} instance.
   *
   * @param actual  the actual value in the failed assertion.
   * @param aPackage the expected package
   * @return the created {@code ErrorMessageFactory}.
   */
  public static ErrorMessageFactory shouldHavePackage(Class<?> actual, Package aPackage) {
    return shouldHavePackage(actual, aPackage.getName());
  }

  /**
   * Creates a new <code>ShouldHavePackage</code> with a package name.
   *
   * @param actual      the actual value in the failed assertion.
   * @param packageName the expected package name
   * @return the created {@code ErrorMessageFactory}.
   */
  public static ErrorMessageFactory shouldHavePackage(Class<?> actual, String packageName) {<FILL_FUNCTION_BODY>}

  private ShouldHavePackage(Class<?> actual, String expectedPackage) {
    super(SHOULD_HAVE_PACKAGE + BUT_HAD_NONE, actual, expectedPackage);
  }

  private ShouldHavePackage(Class<?> actual, String expectedPackage, String actualPackage) {
    super(SHOULD_HAVE_PACKAGE + BUT_HAD, actual, expectedPackage, actualPackage);
  }

}

    final Package actualPackage = actual.getPackage();
    return (actualPackage == null)
        ? new ShouldHavePackage(actual, packageName)
        : new ShouldHavePackage(actual, packageName, actualPackage.getName());
  
<methods>public transient void <init>(java.lang.String, java.lang.Object[]) ,public java.lang.String create(org.assertj.core.description.Description, org.assertj.core.presentation.Representation) ,public java.lang.String create(org.assertj.core.description.Description) ,public java.lang.String create() ,public boolean equals(java.lang.Object) ,public int hashCode() ,public java.lang.String toString() <variables>protected final non-sealed java.lang.Object[] arguments,protected final non-sealed java.lang.String format,org.assertj.core.error.MessageFormatter formatter