@Test public void intLength_whenFileDoesNotExist_shouldReturnZero() throws Exception { File file = new File(expectedFilePath); assertThat(file.exists()).isFalse(); int length = Files.intLength(file); assertThat(length).isEqualTo(0); }
public static int intLength(File file) { if (file == null) { return 0; } long length = file.length(); if (length < Integer.MAX_VALUE) { return (int) length; } else { return Integer.MAX_VALUE; } }
Files { public static int intLength(File file) { if (file == null) { return 0; } long length = file.length(); if (length < Integer.MAX_VALUE) { return (int) length; } else { return Integer.MAX_VALUE; } } }
Files { public static int intLength(File file) { if (file == null) { return 0; } long length = file.length(); if (length < Integer.MAX_VALUE) { return (int) length; } else { return Integer.MAX_VALUE; } }  }
Files { public static int intLength(File file) { if (file == null) { return 0; } long length = file.length(); if (length < Integer.MAX_VALUE) { return (int) length; } else { return Integer.MAX_VALUE; } }  static File createDirectory(String absolutePath); static int intLength(File file); }
Files { public static int intLength(File file) { if (file == null) { return 0; } long length = file.length(); if (length < Integer.MAX_VALUE) { return (int) length; } else { return Integer.MAX_VALUE; } }  static File createDirectory(String absolutePath); static int intLength(File file);  }