ProjectFile { public static ProjectFile from(final Path path) throws IOException { try (final InputStream in = newInputStream(path)) { return ProjectFile.from(in); } }  static ProjectFile from(final Path path); static ProjectFile from(final InputStream in); String getTargetPath(final Path project); String toJson();  }
@Test @PrepareForTest(ProjectFile.class) public void testFrom() throws IOException { Path path = mock(Path.class); mockStatic(Files.class); when(Files.newInputStream(path)).thenReturn(openWithExtensionAs("json")); ProjectFile file = ProjectFile.from(path); assertNotNull(file); }