@Test
@Ignore("The exception throwing does not work")
public void testGetItemFile_encodingError() throws Exception {

    File file = new File("/dir/");
    when(mockContext.getExternalFilesDir(null)).thenReturn(file);
    Configuration.Item item = new Configuration.Item();
    // Test encoding fails
    item.location = "https://example.com/";
    assertEquals(new File("/dir/https%3A%2F%2Fexample.com%2F"), FileHelper.getItemFile(mockContext, item));
    // TODO: The following PowerMockito code prints the exception, but does not fail
    mockStatic(java.net.URLEncoder.class);
    when(java.net.URLEncoder.encode(anyString(), anyString())).thenThrow(new UnsupportedEncodingException("foo"));
    assertNull(FileHelper.getItemFile(mockContext, item));
}