class ShouldHavePort extends BasicErrorMessageFactory {

  private static final int NO_PORT = -1;
  private static final String SHOULD_HAVE_NO_PORT = "%nExpecting actual:%n  <%s>%nnot to have a port but had:%n  <%s>";
  private static final String SHOULD_HAVE_PORT = "%nExpecting port of%n  <%s>%nto be:%n  <%s>%nbut was:%n  <%s>";

  public static ErrorMessageFactory shouldHavePort(URI actual, int expectedPort) {<FILL_FUNCTION_BODY>}

  private ShouldHavePort(URI actual, int expectedPort) {
    super(SHOULD_HAVE_PORT, actual, expectedPort, actual.getPort());
  }

  private ShouldHavePort(URI actual) {
    super(SHOULD_HAVE_NO_PORT, actual, actual.getPort());
  }

  public static ErrorMessageFactory shouldHavePort(URL actual, int expectedPort) {
    return expectedPort == NO_PORT ? new ShouldHavePort(actual) : new ShouldHavePort(actual, expectedPort);
  }

  private ShouldHavePort(URL actual, int expectedPort) {
    super(SHOULD_HAVE_PORT, actual, expectedPort, actual.getPort());
  }

  private ShouldHavePort(URL actual) {
    super(SHOULD_HAVE_NO_PORT, actual, actual.getPort());
  }
}

    return expectedPort == NO_PORT ? new ShouldHavePort(actual) : new ShouldHavePort(actual, expectedPort);
  
<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