@Test void matchesReturnsFalseIfContentIsNotTheSameType() { final List<BodyContent<?>> bodyContents = asList( arrayBody(emptyList()), stringBody(""), objectBody(emptyMap()) ); bodyContents.forEach(bodyContent -> assertThat(underTest.matches(bodyContent)).isFalse()); }
@Override public boolean matches(Body<?> other) { return other instanceof LiteralBodyContent && content.matches(((LiteralBodyContent)other).getContent()); }
LiteralBodyContent extends BodyContent<String> { @Override public boolean matches(Body<?> other) { return other instanceof LiteralBodyContent && content.matches(((LiteralBodyContent)other).getContent()); } }
LiteralBodyContent extends BodyContent<String> { @Override public boolean matches(Body<?> other) { return other instanceof LiteralBodyContent && content.matches(((LiteralBodyContent)other).getContent()); } private  LiteralBodyContent(Object content); }
LiteralBodyContent extends BodyContent<String> { @Override public boolean matches(Body<?> other) { return other instanceof LiteralBodyContent && content.matches(((LiteralBodyContent)other).getContent()); } private  LiteralBodyContent(Object content); @Override String getContent(); @Override boolean matches(Body<?> other); @Override LiteralBodyContent copy(); @Override BodyContentType getType(); static LiteralBodyContent literalBody(Object content); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
LiteralBodyContent extends BodyContent<String> { @Override public boolean matches(Body<?> other) { return other instanceof LiteralBodyContent && content.matches(((LiteralBodyContent)other).getContent()); } private  LiteralBodyContent(Object content); @Override String getContent(); @Override boolean matches(Body<?> other); @Override LiteralBodyContent copy(); @Override BodyContentType getType(); static LiteralBodyContent literalBody(Object content); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }