@Test public void shouldBuildExtensionFromExtension() throws Exception { String token1 = "x-kaazing-foo"; ExtensionHeaderBuilder ext1 = new ExtensionHeaderBuilder(token1); ExtensionHeaderBuilder ext2 = new ExtensionHeaderBuilder(ext1); Assert.assertTrue(String.format("Expected exts %s to %s to be equal", ext1, ext2), ext1.equals(ext2)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof ExtensionHeader)) return false; ExtensionHeader that = (ExtensionHeader) o; return Objects.equals(extensionToken, that.getExtensionToken()); }
ExtensionHeaderBuilder implements ExtensionHeader { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof ExtensionHeader)) return false; ExtensionHeader that = (ExtensionHeader) o; return Objects.equals(extensionToken, that.getExtensionToken()); } }
ExtensionHeaderBuilder implements ExtensionHeader { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof ExtensionHeader)) return false; ExtensionHeader that = (ExtensionHeader) o; return Objects.equals(extensionToken, that.getExtensionToken()); } ExtensionHeaderBuilder(String extension);  ExtensionHeaderBuilder(ExtensionHeader extension); }
ExtensionHeaderBuilder implements ExtensionHeader { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof ExtensionHeader)) return false; ExtensionHeader that = (ExtensionHeader) o; return Objects.equals(extensionToken, that.getExtensionToken()); } ExtensionHeaderBuilder(String extension);  ExtensionHeaderBuilder(ExtensionHeader extension); @Override String getExtensionToken(); @Override List<ExtensionParameter> getParameters(); @Override boolean hasParameters(); ExtensionHeader done(); ExtensionHeaderBuilder setExtensionToken(String token); ExtensionHeaderBuilder append(ExtensionParameter parameter); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); void appendParameter(String parameterContents); void appendParameter(String parameterName, String parameterValue); }
ExtensionHeaderBuilder implements ExtensionHeader { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof ExtensionHeader)) return false; ExtensionHeader that = (ExtensionHeader) o; return Objects.equals(extensionToken, that.getExtensionToken()); } ExtensionHeaderBuilder(String extension);  ExtensionHeaderBuilder(ExtensionHeader extension); @Override String getExtensionToken(); @Override List<ExtensionParameter> getParameters(); @Override boolean hasParameters(); ExtensionHeader done(); ExtensionHeaderBuilder setExtensionToken(String token); ExtensionHeaderBuilder append(ExtensionParameter parameter); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); void appendParameter(String parameterContents); void appendParameter(String parameterName, String parameterValue);  }