### Question:
PluginApiUtils { public static TextRange newRange(InputFile inputFile, UastNode.Token token) { return inputFile.newRange( token.line, token.column - 1, token.endLine, token.endColumn); } private  PluginApiUtils(); static TextRange newRange(InputFile inputFile, UastNode.Token token); static TextRange newRange(InputFile inputFile, UastNode from, UastNode to);  }### Answer:
@Test void newRange_should_call_newRange_on_inputFile() { String value = "dummy value"; int line = 7; int column = 13; UastNode.Token token = new UastNode.Token(line, column, value); InputFile inputFile = mock(InputFile.class); PluginApiUtils.newRange(inputFile, token); verify(inputFile).newRange(eq(line), eq(column - 1), eq(line), eq(column - 1 + value.length())); }
@Test void newRange_should_use_single_token_for_comments() { String value = " int line = 7; int column = 13; int endColumn = 11; UastNode.Token commentToken = new UastNode.Token(line, column, value); UastNode commentNode = new UastNode(Collections.singleton(UastNode.Kind.COMMENT), null, commentToken, Collections.emptyList()); InputFile inputFile = mock(InputFile.class); PluginApiUtils.newRange(inputFile, commentNode, commentNode); verify(inputFile).newRange(eq(line), eq(column - 1), eq(line + 1), eq(endColumn)); }
@Test void newRange_should_use_single_token_for_structuredcomments() { String value = ""; int line = 7; int column = 13; int endColumn = 14; UastNode.Token commentToken = new UastNode.Token(line, column, value); UastNode commentNode = new UastNode(Collections.singleton(UastNode.Kind.STRUCTURED_COMMENT), null, commentToken, Collections.emptyList()); InputFile inputFile = mock(InputFile.class); PluginApiUtils.newRange(inputFile, commentNode, commentNode); verify(inputFile).newRange(eq(line), eq(column - 1), eq(line + 1), eq(endColumn)); }