code: private boolean areTypesSame(String from, String to)
     {
        String fromCompare = from.endsWith(".java") ? from.substring(0, from.length() - 5) : from;
        String toCompare = to.endsWith(".java") ? to.substring(0, to.length() - 5) : to;
        return fromCompare.equals(toCompare);
     }
docs: Checks if the types are the same, removing the ".java" in the end of the string in case it exists
  
  @param from
  @param to
  @return