### Question:
Frame { public static FrameBusNamePair fromLogFileNotation(String line) { if(!LogFileNotationPattern.matcher(line).matches()) return null; int dotPos = -1; for(int i=1;i<line.length();i++) { if(line.charAt(i) == '.') { dotPos = i; break; } } if(dotPos == -1) return null; int bracketPos = dotPos + 7; long usecs = Long.parseLong(line.substring(1, dotPos)) * 1000000 + Long.parseLong(line.substring(dotPos+1, bracketPos)); int idPos = -3; int busStart = -1; int busStop = -1; for(int i=bracketPos+1;i<line.length();i++) { switch(idPos) { case -3: if(line.charAt(i) != ' ') { busStart = i; idPos = -2; } break; case -2: if(line.charAt(i) == ' ') { busStop = i-1; idPos = -1; } break; case -1: if(line.charAt(i) != ' ') { idPos = i; } break; default: break; } if(idPos >= 0) break; } if(idPos < 0) return null; if(busStart == -1 || busStop == -1) return null; String busName = line.substring(busStart, busStop+1); int hashPos = -1; for(int i=idPos+1;i<line.length();i++) { if(line.charAt(i) == '#') { hashPos = i; break; } } int identifier = Integer.parseInt(line.substring(idPos, hashPos), 16); byte[] message = Util.hexStringToByteArray(line.substring(hashPos+1, line.length())); Frame frame = null; if(hashPos-idPos <= 3) { frame = new Frame(2047 & identifier, false, message); } else { frame = new Frame(536870911 & identifier, true, message); } frame.setTimestamp(usecs); return new FrameBusNamePair(frame, busName); } Frame();  Frame(int identifier, boolean extended, byte[] data);  Frame(int identifier, boolean extended, byte[] data, long timestamp); Bus getBus(); void setBus(Bus bus); void setTimestamp(long timestamp); long getTimestamp(); int getIdentifier(); int getLength(); boolean isExtended(); void setData(byte[] data); byte[] getData(); @Override String toString(); String toLogFileNotation(); static FrameBusNamePair fromLogFileNotation(String line); static final Pattern LogFileNotationPattern; }### Answer:
@Test public void testFromLogFileNotation() { System.out.println("fromLogFileNotation"); String line = "(1244101432.788973) can1 040#4B0B000000000000"; String busName = ""; Frame.FrameBusNamePair result = Frame.fromLogFileNotation(line); assertEquals(1244101432788973L, result.getFrame().getTimestamp()); assertEquals(0x40, result.getFrame().getIdentifier()); assertEquals("can1", result.getBusName()); }