@Test
    public void testFilter() throws Exception {

        StringWriter stringWriter = new StringWriter();
        GuacamoleWriter writer = new FilteredGuacamoleWriter(new WriterGuacamoleWriter(stringWriter),
                                                             new TestFilter());

        // Write a few chunks of complete instructions
        writer.write("3.yes,1.A;2.no,1.B;3.yes,1.C;3.yes,1.D;4.nope,1.E;".toCharArray());
        writer.write("1.n,3.abc;3.yes,5.hello;2.no,4.test;3.yes,5.world;".toCharArray());

        // Validate filtered results
        assertEquals("3.yes,1.A;3.yes,1.C;3.yes,1.D;3.yes,5.hello;3.yes,5.world;", stringWriter.toString());

    }
Filter which allows through "yes" instructions but drops all others.
guacamole-common/src/test/java/org/apache/guacamole/protocol/FilteredGuacamoleWriterTest.java