@Override
    public byte[] getValueFromFile(String filename, String encoding, boolean hasVariable, Cache<Object,Object> cache) {
        byte[] bytes;

        if (hasVariable) {
            String stringValue = delegate.getValueFromFile(filename, encoding, hasVariable, cache);
            try {
                bytes = stringValue.getBytes(encoding);
            } catch (UnsupportedEncodingException e) {
                throw new RuntimeException("Unable to read " + filename, e);
            }
        } else {
            bytes = (byte[]) cache.get(filename, _p -> getContent(filename));
        }

        return bytes;
    }
@Test
    public void getValueFromFile_withInvalidEncoding() {
        RuntimeException ex = Assertions.assertThrows(
                RuntimeException.class,
                () -> render.getValueFromFile("utf8.txt", "banana", true, cache)
        );
        MatcherAssert.assertThat(
                ex,
                allOf(
                        hasMessage(containsString("utf8.txt")),
                        hasCause(instanceOf(UnsupportedEncodingException.class))
                )
        );
    }