code: private String getJustifiedText(String text) {
          String[] words = text.split(NORMAL_SPACE);
  
          for (String word : words) {
              boolean containsNewLine = (word.contains("\n") || word.contains("\r"));
  
              if (fitsInSentence(word, currentSentence, true)) {
                  addWord(word, containsNewLine);
              } else {
                  sentences.add(fillSentenceWithSpaces(currentSentence));
                  currentSentence.clear();
                  addWord(word, containsNewLine);
              }
          }
  
          //Making sure we add the last sentence if needed.
          if (currentSentence.size() > 0) {
              sentences.add(getSentenceFromList(currentSentence, true));
          }
  
          //Returns the justified text.
          return getSentenceFromList(sentences, false);
      }
docs: Retrieves a String with appropriate spaces to justify the text in the TextView.
  
  @param text Text to be justified
  @return Justified text