ServerConfigImpl implements ServerConfig { public static ServerConfigImpl createFromEndpoint(Endpoint endpoint, boolean devfileEndpoint) { HashMap<String, String> attributes = new HashMap<>(endpoint.getAttributes()); attributes.put(SERVER_NAME_ATTRIBUTE, endpoint.getName()); String protocol = attributes.remove("protocol"); if (isNullOrEmpty(protocol)) { protocol = "http"; } String path = attributes.remove("path"); String isPublic = attributes.remove(PUBLIC_ENDPOINT_ATTRIBUTE); if ("false".equals(isPublic)) { ServerConfig.setInternal(attributes, true); } if (devfileEndpoint) { attributes.put(REQUIRE_SUBDOMAIN, Boolean.TRUE.toString()); } return new ServerConfigImpl(Integer.toString(endpoint.getPort()), protocol, path, attributes); } ServerConfigImpl();  ServerConfigImpl(
      String port, String protocol, String path, Map<String, String> attributes);  ServerConfigImpl(ServerConfig serverConf); @Override String getPort(); void setPort(String port); ServerConfigImpl withPort(String port); @Override String getProtocol(); void setProtocol(String protocol); ServerConfigImpl withProtocol(String protocol); @Override String getPath(); void setPath(String path); ServerConfigImpl withPath(String path); @Override Map<String, String> getAttributes(); void setAttributes(Map<String, String> attributes); ServerConfigImpl withAttributes(Map<String, String> attributes); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static ServerConfigImpl createFromEndpoint(Endpoint endpoint, boolean devfileEndpoint); static ServerConfigImpl createFromEndpoint(Endpoint endpoint);  }
@Test public void testCreateFromEndpointTranslatePublicTrue() { ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint( new EndpointImpl("name", 123, singletonMap("public", "true"))); assertFalse(serverConfig.isInternal()); }
@Test public void testCreateFromEndpointTranslatePublicWhatever() { ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint( new EndpointImpl("name", 123, singletonMap("public", "whatever"))); assertFalse(serverConfig.isInternal()); }