@Nullable
    @Override
    public Message decode(@Nonnull RawMessage rawMessage) {
        final String msg = new String(rawMessage.getPayload(), charset);
        try (Timer.Context ignored = this.decodeTime.time()) {
            final ResolvableInetSocketAddress address = rawMessage.getRemoteAddress();
            final InetSocketAddress remoteAddress;
            if (address == null) {
                remoteAddress = null;
            } else {
                remoteAddress = address.getInetSocketAddress();
            }
            return parse(msg, remoteAddress == null ? null : remoteAddress.getAddress(), rawMessage.getTimestamp());
        }
    }
@Test
    public void rfc3164_section5_4_messages() {
        // See https://tools.ietf.org/html/rfc3164#section-5.4
        final Map<String, Map<String, Object>> rfc3164messages = ImmutableMap.of(
            "<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8",
            ImmutableMap.of(
                "timestamp", new DateTime(YEAR + "-10-11T22:14:15"),
                "source", "mymachine",
                "level", 2,
                "facility", "security/authorization",
                "message", "mymachine su: 'su root' failed for lonvick on /dev/pts/8"),

            "<13>Feb  5 17:32:18 10.0.0.99 Use the BFG!",
            ImmutableMap.of(
                "timestamp", new DateTime(YEAR + "-02-05T17:32:18"),
                "source", "10.0.0.99",
                "level", 5,
                "facility", "user-level",
                "message", "10.0.0.99 Use the BFG!")

            /* FAILING
            "<165>Aug 24 05:34:00 CST 1987 mymachine myproc[10]: %% It's time to make the do-nuts.  %%  Ingredients: Mix=OK, Jelly=OK # Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport: Conveyer1=OK, Conveyer2=OK # %%",
            ImmutableMap.of(
                "timestamp", new DateTime("1987-08-24T05:34:00", DateTimeZone.forID("CST6CDT")),
                "source", "mymachine",
                "level", 5,
                "facility", "local4"
            )
            */

            /* FAILING
            "<0>1990 Oct 22 10:52:01 TZ-6 scapegoat.dmz.example.org 10.1.2.3 sched[0]: That's All Folks!",
            ImmutableMap.of(
                "timestamp", new DateTime("1990-10-22T10:52:01", DateTimeZone.forID("Etc/GMT-6")),
                "source", "scapegoat.dmz.example.org",
                "level", 0,
                "facility", "kernel"
            )
            */
        );

        for (Map.Entry<String, Map<String, Object>> entry : rfc3164messages.entrySet()) {
            final Message message = codec.decode(buildRawMessage(entry.getKey()));
            assertThat(message).isNotNull();
            assertThat(message.getFields()).containsAllEntriesOf(entry.getValue());
        }
    }