@Test
  public void testWithDirectory_existsButNotDirectory() throws IOException {
    Path file = temporaryFolder.newFile().toPath();

    try {
      Cache.withDirectory(file);
      Assert.fail();

    } catch (CacheDirectoryCreationException ex) {
      MatcherAssert.assertThat(
          ex.getCause(), CoreMatchers.instanceOf(FileAlreadyExistsException.class));
    }
  }
Gets the size of {@code blob}.

@param blob the {@link Blob}
@return the size (in bytes) of {@code blob}
@throws IOException if an I/O exception occurs
jib-core/src/test/java/com/google/cloud/tools/jib/cache/CacheTest.java