### Question:
MyDocumentModel { public String getTokenBeforePosition(Position position) { Line route = getLine(position.getLine()); if (route == null) { return ""; } return retrieveTokenBeginning(position, route); } MyDocumentModel(String text, AnalysisResult analysisResult);  MyDocumentModel(String text); Line getLine(int number); String getTokenBeforePosition(Position position); String getFullTokenAtPosition(Position position);  }### Answer:
@Test void testGetTokenEmptyPosition() { Position pos = new Position(); assertEquals("", model.getTokenBeforePosition(pos)); }
@Test void testGetTokenInvalidPosition() { Position pos = new Position(-1, -1); assertEquals("", model.getTokenBeforePosition(pos)); }
@Test void testPositionAtDelimiter() { Position pos = new Position(1, 19); assertEquals("", model.getTokenBeforePosition(pos)); }
@Test void testGetTokenInvalid() { Position pos = new Position(0, -1); assertEquals("", model.getTokenBeforePosition(pos)); }
@Test void testTokenRetrieving() { MyDocumentModel model = new MyDocumentModel("a bc\r\nde", AnalysisResult.empty()); assertEquals("", model.getTokenBeforePosition(new Position(0, 0))); assertEquals("a", model.getTokenBeforePosition(new Position(0, 1))); assertEquals("bc", model.getTokenBeforePosition(new Position(0, 4))); assertEquals("d", model.getTokenBeforePosition(new Position(1, 1))); assertEquals("de", model.getTokenBeforePosition(new Position(1, 2))); }