@Test
    public void nonExistentFile() throws Exception {
        final HttpFile cached = HttpFile.ofCached(HttpFile.nonExistent(), Integer.MAX_VALUE);
        assertThat(cached.readAttributes(executor).join()).isNull();
        assertThat(cached.readHeaders(executor).join()).isNull();
        assertThat(cached.read(executor, alloc).join()).isNull();
        assertThat(cached.aggregate(executor).join()).isSameAs(AggregatedHttpFile.nonExistent());
        assertThat(cached.aggregateWithPooledObjects(executor, alloc).join())
                .isSameAs(AggregatedHttpFile.nonExistent());

        final ServiceRequestContext ctx = ServiceRequestContext.of(HttpRequest.of(HttpMethod.GET, "/"));
        assertThat(cached.asService().serve(ctx, ctx.request()).aggregate().join().status())
                .isEqualTo(HttpStatus.NOT_FOUND);
    }
Makes sure a non-existent file is handled as expected.
core/src/test/java/com/linecorp/armeria/server/file/CachingHttpFileTest.java