@SuppressWarnings("unchecked")
  public <V extends FileAttributeView> @Nullable V getFileAttributeView(
      FileLookup lookup, Class<V> type) {
    AttributeProvider provider = providersByViewType.get(type);

    if (provider != null) {
      return (V) provider.view(lookup, createInheritedViews(lookup, provider));
    }

    return null;
  }
@Test
  public void testGetFileAttributeView_isNullForUnsupportedView() {
    final File file = createFile();
    FileLookup fileLookup =
        new FileLookup() {
          @Override
          public File lookup() throws IOException {
            return file;
          }
        };
    assertThat(service.getFileAttributeView(fileLookup, PosixFileAttributeView.class)).isNull();
  }