### Question:
TimeUnitMismatch extends BugChecker implements AssignmentTreeMatcher,
        MethodInvocationTreeMatcher,
        NewClassTreeMatcher,
        VariableTreeMatcher { @VisibleForTesting static TimeUnit unitSuggestedByName(String name) { if (name.equals("second") || name.equals("getSecond")) { return null; } if (name.equals("secondsPart")) { return NANOSECONDS; } if (name.equals("msToS")) { return SECONDS; } List<String> words = fixUnitCamelCase(splitToLowercaseTerms(name)); if (words.get(0).equals("second")) { return null; } if (hasNameOfFromUnits(words)) { return null; } if (isNamedForNumberOfUnits(words)) { return null; } Set<TimeUnit> units = timeUnits(words); return units.size() == 1 ? getOnlyElement(units) : null; }  @Override Description matchAssignment(AssignmentTree tree, VisitorState state); @Override Description matchVariable(VariableTree tree, VisitorState state); @Override Description matchNewClass(NewClassTree tree, VisitorState state); @Override Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state);  }### Answer:
@Test public void testUnitSuggestedByName() { assertSeconds("sleepSec", "deadlineSeconds", "secondsTimeout", "msToS"); assertUnknown( "second", "getSecond", "SECOND", "secondDeadline", "twoSeconds", "THIRTY_SECONDS", "fromSeconds", "x", "millisMicros"); assertMillis( "millis", "MILLIS", "someMillis", "timeoutMilli", "valueInMills", "mSec", "deadlineMSec", "milliSecond", "milliSeconds", "FOO_MILLI_SECONDS", "dateMS", "dateMs", "dateMsec", "msRemaining"); assertMicros("micro", "us"); assertNanos("nano", "secondsPart"); }