How can I simplify this set of if statements? (Or, what’s making it feel so awkward?)
One reason it looks like a lot of code is that it is very repetitive. Use variables to store the parts that are repeated, and that will help with the readability: private List<Foo> parseResponse(Response<ByteString> response) { Status status = response.status(); int code = status.code(); boolean payloadAbsent = !response.payload().isPresent(); if (code != Status.OK.code() || payloadAbsent) { … Read more